Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wait Cursor in VSTO word add-in application

Tags:

c#

vsto

add-in

I am creating a VSTO word add in. i'm starting a long elaboration from ThisAddin and i would like to change the cursor to WaitCursor, so if I go to Globals.ThisAddIn.Application, there is no cursor property and i've tried with Cursor.Current = Cursors.WaitCursor; when starting the elaboration, and Cursor.Current = Cursors.Default; at the end of the elaboration, but doesn't work, the cursor doesn't change.

Any ideas on how to do this?

like image 358
Matt3o Avatar asked Oct 17 '25 14:10

Matt3o


1 Answers

private static void SetCursorToWaiting()
{
   Microsoft.Office.Interop.Word.Application application = Globals.ThisAddIn.Application;
   application.System.Cursor = wdCursorWait;
}
private static void SetCursorToDefault()
{
   Microsoft.Office.Interop.Word.Application application = Globals.ThisAddIn.Application;
   application.System.Cursor = wdCursorNormal;
}
like image 115
Masoud Avatar answered Oct 19 '25 03:10

Masoud



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!