//这是我的代码
private void btnGenSumm_Click(object sender, EventArgs e)
{
if (backgroundWorker1.IsBusy != true)
{
btnGenSumm.Enabled = false;
btnExpSum.Enabled = false;
btnClose.Enabled = false;
pBox1.Visible = true;
backgroundWorker1.RunWorkerAsync();
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
BackgroundWorker worker = sender as BackgroundWorker;
loadSummSales(); // this is the process
System.Threading.Thread.Sleep(50);
}
private void backgroundWorker1_RunWorkerCompleted(object sender,
RunWorkerCompletedEventArgs e)
{
pBox1.Visible = false;
}
第一次单击时执行该过程没有错误,但是当我尝试再次单击命令按钮(btnGenSumm)以重复该过程时,出现错误“在执行 createhandle 时无法调用值处理”。请帮助我有了这个。