Wait Cursor in VSTO word add-in application

可紊 提交于 2019-12-04 06:13:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!