I have a long running VSTO procedure running. During its processing, I would like to display hourclass as the cursor. Please advice how to change the word's cursor.
Thanks,
Yuhang
I have a long running VSTO procedure running. During its processing, I would like to display hourclass as the cursor. Please advice how to change the word's cursor.
Thanks,
Yuhang
Set wait cursor for word document
Rob Washo
You may want to read a post I did to figure out how to invoke back to the main thread if you have similar situation. (Hint its not on the Mainworksheet but off of the control!)(Threading issues GUI updates in the Action Pane)
Here is my code for the hourglass, note it needed state due to other operations, hence the WaitCursorOperational boolean:
#region Wait cursor
bool WaitCursorOperational = false;
private void WaitCursorSet()
{
if (WaitCursorOperational == false)
{
originalCursor = this.Application.Cursor;
this.Application.Cursor = XlMousePointer.xlWait;
WaitCursorOperational = true;
}
}
private void WaitCursorEnd()
{
this.Application.Cursor = originalCursor;
WaitCursorOperational = false;
}
#endregion
Kevinbe