问题
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?
回答1:
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;
}
回答2:
Try the Mouse.OverrideCursor. Here are the possible options.
来源:https://stackoverflow.com/questions/26241030/wait-cursor-in-vsto-word-add-in-application