I have been developing the code to customise ms-word application and am getting data from exchange server and displaying it. so till the data comes to ms-word i want to show "busy" hour glass symbol. but after execution goes out from the button handler(fraction of seconds) the busy symbole is loosing.
I have one button called "Receive" in the ms-word customised ribbon, so when i press then busy symbol need to be loaded and till the data comes to ms-word from exchange then the symbol has to be retained.
i am using the following code:-
public class MyCursor : IDisposable
{
private Cursor _preappCursor;
public MyCursor ()
{
_preappCursor= Mouse.OverrideCursor;
Mouse.OverrideCursor = Cursors.Wait;
}
#region IDisposable Members
public void Dispose()
{
Mouse.OverrideCursor = _preappCursor;
}
#endregion
}
using(new MyCursor ())
{
//Receive side bar calls the exchange code here and display in ms-word
}