VSTO 字插件应用程序中的等待光标

Mat*_*t3o 2 c# vsto add-in

我正在创建一个 VSTO 字添加。我正在从 ThisAddin 开始一个很长的阐述,我想将光标更改为 WaitCursor,所以如果我去 Globals.ThisAddIn.Application,没有光标属性,我试过了withCursor.Current = Cursors.WaitCursor;开始细化时和细化Cursor.Current = Cursors.Default;结束时,但不起作用,光标不会改变。

关于如何做到这一点的任何想法?

Mas*_*oud 5

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;
}
Run Code Online (Sandbox Code Playgroud)