Thought this thread is a few months old, ill answer anyways.Hope this helps out Gary. (Im not a C# fan... so its vb here)I'm having the same problem understanding where this would be implemented using an ArcMap 10 Add-in.
I'd like two of my toolbar buttons to default to 'image and text' but the only place I can see the toolbar referenced is in the Config.esriaddinx XML.
Where should this code be placed so that if fires on startup?
A VB.Net code snippet would be a bonus.
Assume I have a toolbar named 'Toolbar1' and a single button named 'Button1'.
Cheers.
I have read other methods such as through the extension if one is created. Where is the code Fired from? ENABLED propertyPublic ReadOnly Property Enabled() As Boolean Implements ICommand.Enabled
SetAsInconAndText()
end Property
And here is the call 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 created!
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 = "Property NAME used for tool" Then ' use the Property NAME of the button
pCommandBar.Item(i).Style = esriCommandStyles.esriCommandStyleIconAndText
Exit For
End If
Next
End If
End Sub