这个问题好解决 用多线程解决;;我给你一段实例代码
void ChangeText()
{
button2.Enabled = false;
for (int i = 0; i < 999999999; i++)
{
}
MessageBox.Show("循环完毕:)");
button2.Enabled = true;
}
/// <summary>
/// 多线程
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
Thread thread = new Thread(ChangeText);
thread.IsBackground = true;
thread.Start();
} |