问题
I'm designing an Excel Addins with Ribbons like this:
- The Ribbon Name is
Ribbon1
- The Tab Name is
Tab1
- The ToggleButton name is
tglShowNavigation
What I need is:
From the
ThisAddIn.cs
, in theThisAddIn_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:
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!
回答1:
You can get access to the control by using
Globals.Ribbons.Ribbon1.tglShowNavigation
Make sure you've changed the modifier of the button to something you can reach, one example could be "Internal".
来源:https://stackoverflow.com/questions/61057803/c-sharp-vsto-excel-addins-how-can-i-access-ribbons-controls-from-the-addins-thi