【问题标题】:Wait Cursor in VSTO word add-in applicationVSTO 字加载项应用程序中的等待光标
【发布时间】:2014-10-07 16:41:46
【问题描述】:

我正在创建一个 VSTO 词添加。我正在从 ThisAddin 开始长时间的阐述,我想将光标更改为 WaitCursor,所以如果我转到 Globals.ThisAddIn.Application,没有光标属性,我'在开始阐述时尝试使用Cursor.Current = Cursors.WaitCursor;,在阐述结束时尝试使用Cursor.Current = Cursors.Default;,但不起作用,光标不会改变。

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

【问题讨论】:

  • 在此期间您有解决方案吗?

标签: c# vsto add-in


【解决方案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;
}

【讨论】:

  • 对于 Excel,Application 对象上有一个属性 CursorGlobals.ThisAddIn.Application.Cursor = XlMousePointer.xlWait;
【解决方案2】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-23
    • 1970-01-01
    • 2012-02-06
    • 2022-10-21
    • 2010-10-08
    • 2018-04-08
    • 1970-01-01
    相关资源
    最近更新 更多