0

I've got a C# Application where I work some things in an workerthread. Before I start the workerthread I try to Change the Mouse Cursor in the Button Click Event in the Mainthread. Now I wonder why the Cursor doesn't change.

    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;
        }
    }

What's wrong with my code?

1 Answers1

0

What if you try

this.cursor = Cursors.WaitCursor;   

and

this.cursor = Cursors.Default;

Respectively

Micah Armantrout
  • 6,781
  • 4
  • 40
  • 66