0
我想在此代码中的任何步骤标签中显示该步骤的编号。 在我的代码中只显示标签中的最后一个数字!在循环中的任何步骤中更改label.text
我可以doevent(做),但我认为有时面对的问题
enter code here
private void button1_Click(object sender, EventArgs e)
{
int i = 0;
while (i<100)
{
i++;
label1.Text = string.Format("Step is :{0}", i);
Application.DoEvents();
label1.Invalidate();
System.Threading.Thread.Sleep(1000);
}
}