C#VSTO Excel加载项:如何从加载项ThisAddIn_Startup访问Ribbons控件? [英] C# VSTO Excel Addins: How can I access Ribbons Controls from the Addins ThisAddIn_Startup?

查看:152
本文介绍了C#VSTO Excel加载项:如何从加载项ThisAddIn_Startup访问Ribbons控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计具有如下功能区的Excel加载项:

I'm designing an Excel Addins with Ribbons like this:

  • 功能区名称为 Ribbon1
  • 选项卡名称为 Tab1
  • ToggleButton的名称为 tglShowNavigation

我需要的是:

ThisAddIn.cs 中的 ThisAddIn_Startup 无效中,我希望能够影响/更改ToggleButton tglShowNavigation的标签.

From the ThisAddIn.cs, in the ThisAddIn_Startup void, I would like to be able to Affect/Change the ToggleButton tglShowNavigation's Label.

我尝试了以下操作,但无法从中看到任何控制:

I tried the following but cannot see any control from this:

请从何处以及如何从 ThisAddIn_Startup 访问功能区上的控件?

Where and how could I access the Controls on my Ribbon from the ThisAddIn_Startup please?

注意:我不想从功能区调用全局函数,而只是希望能够直接访问它们.

NB: I don't want to call a global function from the Ribbon, but just want to be able to access them directly.

非常感谢您的宝贵帮助!

Thank you in advanced for you precious help!

推荐答案

您可以使用来访问控件

Globals.Ribbons.Ribbon1.tglShowNavigation

确保已将按钮的修饰符更改为可以访问的内容,例如内部".

Make sure you've changed the modifier of the button to something you can reach, one example could be "Internal".

这篇关于C#VSTO Excel加载项:如何从加载项ThisAddIn_Startup访问Ribbons控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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