AnsweredAssumed Answered

Access Add-in Button.Caption in Code

Question asked by fridjof on Jun 12, 2014
Latest reply on Jun 16, 2014 by fridjof
Dear all,

Can anybody tell me how to read the Caption, Message and Tooltip properties of an ArcMap Add-in Button programmatically? The properties are defined in the Config.esriaddinx file and are shown correctly in ArcMap. However, when I try to query them, say, in the Button's OnClick method, I only get an empty string:

    public class DummyButton : Button     {         protected override void OnClick()         {             MessageBox.Show(string.Format("Button '{0}' was clicked!", this.Caption));         }     }


On the other hand, it is possible to change the properties Message and Tooltip programmatically, and the update is reflected both in ArcMap and in code. The Caption can be changed too and will be available in code, although in ArcMap the button's caption won't be updated. But how to get the values that are defined in the config file? Btw, I'm using ArcGIS for Desktop 10.2.

Thanks for any hints,
Fridjof

Outcomes