如何在VSTO中创建命令 [英] How to create a command in VSTO

查看:72
本文介绍了如何在VSTO中创建命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个功能区。有一个按钮。我想将热键与它联系起来。如果我转到Word /选项/ Cutomize功能区/键盘快捷方式自定义... /类别并选择我的功能区选项卡,命令列表框为空。我在Ribbon
中没有看到任何方法如何将它与Command等关联。

I created a Ribbon. There's a button. I'd like to associate a hotkey with it. If I go to Word / Options / Cutomize Ribbon / Keyboard shortcuts Customize... / Categories and select my Ribbon Tab, the command listbox is empty. I don't see any way in my Ribbon how to associate it with Command, etc.

谢谢

Thanks

推荐答案

Hi,

>>我想将热键关联到它

>>I'd like to associate a hotkey with it

我们需要在ribbon_load事件中指定keytip。

We need to assign the keytip in the ribbon_load event.

由于功能区是从加载项创建的,如果我们想要设置一些属性,我们需要在外接程序项目中设计它。我们无法通过Office应用程序手动设置自定义控件的属性。

Since the ribbon is created from the add-in, if we want to set some properties, we need to design it in the add-in project. We are unable to manually set properties for custom controls by Office application.

     ;    private void Ribbon1_Load(object sender,RibbonUIEventArgs e)

       private void Ribbon1_Load(object sender, RibbonUIEventArgs e)

      ;   {

        {

             button1.KeyTip =" G";

            button1.KeyTip = "G";

         }

        }

问候,

Celeste


这篇关于如何在VSTO中创建命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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