private void btnSort_Click(object sender, EventArgs e) { progressBar1.Maximum = 100; label2.Text = "正在读取数据..."; progressBar1.Value = 0; label2.Visible = true; panel2.Visible = true; lblTime.Visible = true; progressBar1.Visible = true; times = 0; //时间重置 TimerByTime.Start(); // = true;//启动时间记录 lblTime.Text = "已用时间:0秒"; HandleSort task = Sort; //新的 task.BeginInvoke(null, null); label2.Text = "正在对分拣车组任务数据进排程"; }
private void btnSort_Click(object sender, EventArgs e) { this.btnSort.Enabled = false;//防止点击多下 isSort = true; handlesort(3, true); progressBar1.Maximum = 100; label2.Text = "正在读取数据..."; progressBar1.Value = 0; label2.Visible = true; panel2.Visible = true; lblTime.Visible = true; progressBar1.Visible = true; times = 1; //时间重置 TimerByTime.Start(); // = true;//启动时间记录 //Thread thread = new Thread(new ThreadStart(Sort));//旧的 //thread.Start(); HandleSort task = Sort; //新的 task.BeginInvoke(null, null); label2.Text = "正在对分拣车组任务数据进重新排序"; }