On the ribbon, a tab with the name of the Addin displays three buttons: Render, Export, and Import.
internal ButtonDefinitionWrapper MyButton { get; privateset; }
MyButton = CreateButtonDefinition(buttons, addInSite, "MyButton" , CommandTypesEnum .kNonShapeEditCmdType);
An instance of a button displays with the name "MyButton", and the classification of "kNonShapeEditCmdType." Select the appropriate classification, depending on your intended use.
The CreateButtonDefinition method calls a constructor in the ButtonDefinitionWrapper class to create the button. The constructor registers the resources necessary to display the button.
controls.AddButton(MyButton.Target, true );
void MyButton_OnExecute( object sender, ButtonDefinitionWrapper . ExecuteEventArgs e) { // TODO Implement OnExecute Method MessageBox .Show( "MyButton's OnExecute Method" ); }
If removing the existing buttons, you can remove their respective OnExecute handlers.
gui.MyButton.OnExecute += new EventHandler < ButtonDefinitionWrapper. ExecuteEventArgs >(MyButton_OnExecute);
This file defines a set of strings and images for each button.
The <name>_DisplayName string defines the name that displays below the icon for the custom button.
<name>_DescriptionText defines the pause-over text of the custom button.
<name>_ToolTip matches the DescriptionText string .
This view defines the icons for each button. Name your images <name>_LargeIcon and <name>_StandardIcon to ensure that the ButtonDefinitionWrapper class adds them. Size Large icons at 32x32 pixels, and standard icons at 16x16 pixels.