During the start of my windows application, I have to make a call to a web service to retrieve some default data to load onto my application. During the load of the form, I
In WPF, I've done this by setting the Mouse.OverrideCursor property to Cursors.Wait before I start the Backgroundworker, and then resetting it to null in the RunWorkerCompleted event. Seems to work pretty well so far.
public void go()
{
BackgroundWorker thread = new BackgroundWorker();
thread.DoWork += run;
thread.RunWorkerCompleted += taskCompleted;
thread.WorkerReportsProgress = true;
// Change mouse cursor to busy
Mouse.OverrideCursor = Cursors.Wait;
thread.RunWorkerAsync();
}
private void taskCompleted(object sender, RunWorkerCompletedEventArgs e)
{
// Reset mouse cursor
Mouse.OverrideCursor = null;
}