日期:2014-05-17 浏览次数:21317 次
private void button1_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThreadStart(run));
if (button1.Text == "开始")
{
button1.Text = "停止";
th.Start();
}
else if (button1.Text == "停止")
{
th.Abort();
button1.Visible = false;
}
}
Thread th = new Thread(new ThreadStart(run));
private void button1_Click(object sender, EventArgs e) { if (button1.Text == "开始") { button1.Text = "停止"; th.Start(); } else if (button1.Text == "停止") { th.Abort(); button1.Visible = false; }