-4
public partial class Form1 : Form
{
    int billno=2000;
    string code;
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        billno = Convert.ToInt32(code);
        billno = billno + 1;
        textBox1.Text = " "+ billno;

    }
4

1 回答 1

1

试试这个

public partial class Form1 : Form
{
    static int billno=2000;
    string code;
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        billno = billno + 1;
        textBox1.Text = billno.ToString();

    }

这里billno将在每个表单加载事件上增加 1。

于 2012-10-13T11:18:23.087 回答