Hi,ICommandItem.Style will give you the information for arcmap desktop.IToolbarItem.Style will give you the information for ArcEngine.I think you just need to define Style property when you create your toolbarVincent
public sealed class My_Toolbar : BaseToolbar { public My_Toolbar() { // // TODO: Define your toolbar here by adding items // //AddItem("esriArcMapUI.ZoomInTool"); //BeginGroup(); //Separator //AddItem("{FBF8C3FB-0480-11D2-8D21-080009EE4E51}", 1); //undo command //AddItem(new Guid("FBF8C3FB-0480-11D2-8D21-080009EE4E51"), 2); //redo command //"MyToolbarProj.MyTool" is derived from "BaseTool" AddItem("MyToolbarProj.MyTool"); } }
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.
Public ReadOnly Property Enabled() As Boolean Implements ICommand.Enabled SetAsInconAndText() end Property
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
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)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.