Customize Menu Programmatically

166
1
06-24-2020 11:34 AM
MitchellKollodge
New Contributor

Hi,

Is it possible to programmatically change the caption of a custom menu?

I create a menu in my Config.daml as so:

<menus>

<menu id="MyMenu" caption="Initial Caption" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonBlue32.png">
<tooltip heading="Tooltip Heading">
Initial Tooltip<disabledText />
</tooltip>
<button refID="button1" />
<button refID="button2" />
</menu>

</menus>

Then after a button is clicked I try to change the menu's caption using the following code:

IPlugInWrapper menu = FrameworkApplication.GetPlugInWrapper("MyMenu");
menu.Caption = "New Caption";

When running the Add-In I see no change in the menu's caption in the UI, but inspecting with the debugger shows that the caption value does get changed in the code.

I've tested the above approach on buttons, and in that case I can alter the caption.

Thank you!

0 Kudos
1 Reply
UmaHarano
Esri Regular Contributor

Hi Mitchell

This is a bug. The good news is that it is now fixed and will be available with 2.7. Thanks for catching this error and reporting it.

Thanks

Uma