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;
}
答案 0 :(得分: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
会在每个Form加载事件中递增1。