kyanuk1

ArcEngine custom toolbar C#

Discussion created by kyanuk1 on Apr 3, 2014
Latest reply on Apr 3, 2014 by Neil
Hello,

I am playing with the idea of an ArcEngine application with a custom toolbar I can add to the map control, but I am a bit stuck.

I have added a new item -> Base Toolbar, where I can add esri commands:

    [Guid("bf252637-ecde-48c3-9464-238bae6f800e")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("MyProject.MyCustomToolbar")]
    public sealed class MyToolbar: BaseToolbar
    {
         public MyToolbar()
         {
             this.AddItem("{380FB31E-6C24-4F5C-B1DF-47F33586B885}"); //undo command
             this.AddItem(new Guid("B0675372-0271-4680-9A2C-269B3F0C01E8")); //redo command
         }
    }



Is it possible to add buttons to a toolbar like this?  In Arcmap, I have done it through the XML config with classes that inherit from esri addin control classes:

<AddIn language="CLR">
    <ArcMap>
      <Commands>
        <Button class="ButtonClass"


Where the class:

public class ButtonClass : Esri.ArcGIS.Desktop.AddIns.Button
{
}



Has anyone done this with ArcEngine applications?

Outcomes