.disposed
事件处理程序会选择它吗?我似乎无法弄清楚如何分配这个事件处理程序 - 这就是我分配其他事件处理程序的方式:
bw.ProgressChanged += new ProgressChangedEventHandler(
delegate(object o, ProgressChangedEventArgs args)
{
lb_status.Text = args.ProgressPercentage.ToString() + "%";
this.Refresh();
});
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
delegate(object o, RunWorkerCompletedEventArgs args)
{
lb_status.Text = "Ready";
BindingSource source = new BindingSource();
source.DataSource = ds.Tables[0];
dataGridView1.DataSource = source;
source.ResetBindings(false);
button1.Enabled = true;
});
我在try / catch期间使用System.Threading.Thread.CurrentThread.Abort()
中止线程。