C# 在多线程应用程序中设置鼠标光标
我有一个C#应用程序,我在workerthread中处理一些事情。 在启动workerthread之前,我尝试在主线程的Button Click事件中更改鼠标光标。 现在我想知道为什么光标没有改变C# 在多线程应用程序中设置鼠标光标,c#,multithreading,C#,Multithreading,我有一个C#应用程序,我在workerthread中处理一些事情。 在启动workerthread之前,我尝试在主线程的Button Click事件中更改鼠标光标。 现在我想知道为什么光标没有改变 private void barButtonItemBulkImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Cursor.Current = Cursors.WaitCu
private void barButtonItemBulkImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
PxDAL pdal = new PxDAL();
pdal.ReactivateAdressMutation += new PxDAL.Del_ReactivateAdressMutation(ReactivateAdressMutation);
pdal.StartContact();
}
private void ReactivateAdressMutation()
{
if (this.InvokeRequired)
{
this.Invoke(new AdressMutation.Del_BatchImportFinished(ReactivateAdressMutation), new Object[] { });
}
else
{
Cursor.Current = Cursors.Default;
}
}
我的代码出了什么问题?如果您尝试一下该怎么办
this.cursor = Cursors.WaitCursor;
及
分别
this.cursor = Cursors.Default;