在VSTO单词加载项应用程序中等待游标 [英] Wait Cursor in VSTO word add-in application

查看:73
本文介绍了在VSTO单词加载项应用程序中等待游标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个VSTO单词添加项。我正在从ThisAddin开始进行详尽的阐述,我想将光标更改为WaitCursor,因此,如果我转到Globals.ThisAddIn.Application,则没有光标属性,并且已经尝试过 Cursor.Current = Cursors.WaitCursor; 在开始阐述时尝试过,而 Cursor.Current = Cursors.Default; 在详细说明的末尾,但不起作用,光标不会改变。

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?

推荐答案

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;
}

这篇关于在VSTO单词加载项应用程序中等待游标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆