<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change caption, icon, tooltip for Add-in button in program in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632758#M17058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Duncan. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I forgot to add &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;contextHelpItem.Refresh&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;After that my changed caption became visible. I find it strange that you're allowed to change the Caption but not the ToolTip, but oh well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also found out how to change the icon for a different button on the toolbar. I have a button that toggles between a locked/unlocked state. For it work I had to have two bitmap images added as 'Embedded Resource', plus the initial image for the toolbar added separately (different filename) as an AddInContent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rfairhur24: Thanks for your suggestion. I will look into that further, but for now I'll leave the functionality the same. Usually it is done to change the borders of the map to Spanish text even though the ArcMap user is an English speaker. Some of our clients want their map borders in Spanish.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jul 2013 16:11:22 GMT</pubDate>
    <dc:creator>MatthewBuchanan</dc:creator>
    <dc:date>2013-07-02T16:11:22Z</dc:date>
    <item>
      <title>Change caption, icon, tooltip for Add-in button in program</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632755#M17055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm trying to change the icon, caption and tooltip of an button in my custom toolbar. I'm using the add-in process inside Visual Studio. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideally I don't want an icon, just the text "English" or "Spanish" to appear on the toolbar depending on what the user clicks. If I can't have the text then an icon that can alternate between 2 different choices would be ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I try to change the FaceID, ToolTip or Caption ArcMap crashes. I can get the contextHelpItem.Name property so I know I'm getting the correct button and toolbar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS 10.1, Visual Studio 2010, VB.net&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim documentBars As ICommandBars = m_Application.Document.CommandBars Dim barID As UID = New UIDClass barID.Value = "BGC_Engineering_Inc_BGCLayout_Tool_v4_BGC_Layout_Tool" '"{ebecdd6c-d4da-4523-b478-aab7f940b87e}" Dim barItem As ICommandItem = documentBars.Find(barID, False, False) If Not (barItem Is Nothing) Then ' AndAlso barItem.Type = ESRI.ArcGIS.Framework.esriCommandTypes.esriCmdTypeToolbar Then &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim commandBar As ICommandBar = CType(barItem, ICommandBar) &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim commandID As ESRI.ArcGIS.esriSystem.UID = New ESRI.ArcGIS.esriSystem.UIDClass &amp;nbsp;&amp;nbsp;&amp;nbsp; commandID.Value = "BGC_Engineering_Inc_BGCLayout_Tool_version_4_btn_Language" &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim contextHelpItem As ICommandItem = commandBar.Find(commandID, False) &amp;nbsp;&amp;nbsp;&amp;nbsp; If Not contextHelpItem Is Nothing Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' get bitmap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Dim newIcon As System.Drawing.Bitmap &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If g_bEnglish = True Then &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'newIcon = New System.Drawing.Bitmap(Me.GetType(), "Images/btn_Language_en.bmp") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.FaceID = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIPictureDispFromBitmap(newIcon) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.Style = esriCommandStyles.esriCommandStyleTextOnly &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.Caption = "English" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contextHelpItem.Tooltip = "Now English" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'newIcon = New System.Drawing.Bitmap(Me.GetType(), "Images/btn_Language_es.bmp") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.FaceID = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIPictureDispFromBitmap(newIcon) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.Style = esriCommandStyles.esriCommandStyleTextOnly &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'contextHelpItem.Caption = "Spanish" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contextHelpItem.Tooltip = "Now Spanish" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If &amp;nbsp;&amp;nbsp;&amp;nbsp; End If End If&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jun 2013 20:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632755#M17055</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2013-06-26T20:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Change caption, icon, tooltip for Add-in button in program</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632756#M17056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For whats it worth I knocked together the following VBA code and was able to successfully change the caption on a toolbar button which is an ESRI Addin. This is what I used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;Public Sub ChangeText() &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pApp As IApplication &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pApp = Application &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCBs As ICommandBars &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCBs = pApp.Document.CommandBars &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCI As ICommandItem &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCI = pCBs.Find("xxx_xxx_xxx") &amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pCB As ICommandBar &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCB = pCI &amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print pCB.Count ' Number of items of toolbar &amp;nbsp;&amp;nbsp;&amp;nbsp; Set pCI = pCB.Item(0) &amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print pCI.BuiltIn ' Should returns true, which it does! &amp;nbsp;&amp;nbsp;&amp;nbsp; pCI.Style = esriCommandStyleIconAndText &amp;nbsp;&amp;nbsp;&amp;nbsp; pCI.Caption = "Spanish" &amp;nbsp;&amp;nbsp;&amp;nbsp; pCI.Refresh End Sub&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 15:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632756#M17056</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-06-28T15:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change caption, icon, tooltip for Add-in button in program</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632757#M17057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You should look up help on ESRI's website and msdn on the subject of Localization if you are trying to support a variety of local cultural settings, especially if your end users are likely to have their computers configured with different cultural environment settings in Windows.&amp;nbsp; Often many things change when moving between cultures (date and number formats being a common issue), which make you better off when you access the .Net cultural interfaces to manage the localization of your interfaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, check out &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000002s5000000"&gt;this help&lt;/A&gt;&lt;SPAN&gt; and the additional links it has.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 15:19:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632757#M17057</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2013-06-28T15:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change caption, icon, tooltip for Add-in button in program</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632758#M17058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Duncan. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I forgot to add &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;contextHelpItem.Refresh&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;After that my changed caption became visible. I find it strange that you're allowed to change the Caption but not the ToolTip, but oh well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also found out how to change the icon for a different button on the toolbar. I have a button that toggles between a locked/unlocked state. For it work I had to have two bitmap images added as 'Embedded Resource', plus the initial image for the toolbar added separately (different filename) as an AddInContent&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;rfairhur24: Thanks for your suggestion. I will look into that further, but for now I'll leave the functionality the same. Usually it is done to change the borders of the map to Spanish text even though the ArcMap user is an English speaker. Some of our clients want their map borders in Spanish.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 16:11:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-caption-icon-tooltip-for-add-in-button-in/m-p/632758#M17058</guid>
      <dc:creator>MatthewBuchanan</dc:creator>
      <dc:date>2013-07-02T16:11:22Z</dc:date>
    </item>
  </channel>
</rss>

