mike.robb

Addin Button - Icon AND text (Image and Caption)  how?

Discussion created by mike.robb on Apr 7, 2011
Latest reply on Aug 4, 2011 by sscialanca-esriitalia-it-esridist
Hi everyone,

Simple but frustrating problem:
Prior to arcAddinx, there was no problem choosing to have Image / Text or Both for any button when a toolbar was loaded using the following code below triggered off the ENABLED using ESRICommandStyles.  (IToolbarDef)

        Public Sub SetAsIconAndText()

                ' Make sure button is showing Icon And Text
                Dim pUID As New UID
                pUID.Value = "{F53B91E1-C520-41a7-941C-686AA071D1A2}"  ' Toolbar GUID

            Dim pCommandBar As ESRI.ArcGIS.Framework.ICommandBar
            pCommandBar = m_application.Document.CommandBars.Find(pUID, True, False)

            Dim i As Integer
            If Not pCommandBar Is Nothing Then
                For i = 0 To pCommandBar.Count - 1
                    If pCommandBar.Item(i).Name = "FocusCorp_FocusEllipse" Then ' use the Property NAME of the button
                        pCommandBar.Item(i).Style = esriCommandStyles.esriCommandStyleIconAndText
                        Exit For
                    End If
                Next
            End If


        End Sub


I am aware that a user can AFTER the fact customize, but why would ESRI have left this functionality out with Addin XML?

Is there anyone that has found the means to control what each button displays on created toolbars when using Addins as far as Image and Caption?

Suggestions appreciated,

vb.net

Thanks

Outcomes