Change the image and order of the buttons on the toolbar, select and reconfigure the buttons you want to use, and get button events.
Each button is of type System.Windows.Forms.ToolStripButton and can be retrieved and set using that property type.
Example Code
Change the image used in the ToolBarAnnotation's button of the PasteImage object and change the button order.
[Visual Basic.NET]
'Describe the
following in the Form Load event etc.
'* When using annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = True
'Change the button image of "Paste image object"
toolBarAnnotation1.ButtonImage.ImageTransparentColor = Color.Magenta
toolBarAnnotation1.ButtonImage.Image = Image.FromFile("\\img.bmp")
'Clear the contents
toolBarAnnotation1.Items.Clear()
'Create a ToolStripItem to use only some buttons and place them in a different order
Dim items As ToolStripItem() = New ToolStripItem() { _
toolBarAnnotation1.ButtonImage, _
toolBarAnnotation1.ButtonRectangle, _
toolBarAnnotation1.ButtonText, _
toolBarAnnotation1.ButtonSelect, _
toolBarAnnotation1.ButtonDelete, _
toolBarAnnotation1.ButtonProperties _
}
'In the toolbar the order of button configuration and arrangement as set above
toolBarAnnotation1.Items.AddRange(items)
'Get click event for text button
AddHandler toolBarAnnotation1.ButtonText.Click, AddressOf ButtonText_Click
'Text button click event
Private Sub ButtonText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'The contents of the event
End Sub
'* When using annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = True
'Change the button image of "Paste image object"
toolBarAnnotation1.ButtonImage.ImageTransparentColor = Color.Magenta
toolBarAnnotation1.ButtonImage.Image = Image.FromFile("\\img.bmp")
'Clear the contents
toolBarAnnotation1.Items.Clear()
'Create a ToolStripItem to use only some buttons and place them in a different order
Dim items As ToolStripItem() = New ToolStripItem() { _
toolBarAnnotation1.ButtonImage, _
toolBarAnnotation1.ButtonRectangle, _
toolBarAnnotation1.ButtonText, _
toolBarAnnotation1.ButtonSelect, _
toolBarAnnotation1.ButtonDelete, _
toolBarAnnotation1.ButtonProperties _
}
'In the toolbar the order of button configuration and arrangement as set above
toolBarAnnotation1.Items.AddRange(items)
'Get click event for text button
AddHandler toolBarAnnotation1.ButtonText.Click, AddressOf ButtonText_Click
'Text button click event
Private Sub ButtonText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'The contents of the event
End Sub
[Visual C#.NET]
//Describe the
following in the Form Load event etc.
//* When using annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = true;
//Change the button image of "PasteImage object"
toolBarAnnotation1.ButtonImage.ImageTransparentColor = Color.Magenta;
toolBarAnnotation1.ButtonImage.Image = Image.FromFile("\\img.bmp");
//Clear the contents
toolBarAnnotation1.Items.Clear();
//Create a ToolStripItem to use only some buttons and place them in a different order
ToolStripItem[] items = new ToolStripItem[] {
toolBarAnnotation1.ButtonImage,
toolBarAnnotation1.ButtonRectangle,
toolBarAnnotation1.ButtonText,
toolBarAnnotation1.ButtonSelect,
toolBarAnnotation1.ButtonDelete,
toolBarAnnotation1.ButtonProperties
};
//In the toolbar the order of button configuration and arrangement as set above
toolBarAnnotation1.Items.AddRange(items);
//Get click event for text button
toolBarAnnotation1.ButtonText.Click += new EventHandler(ButtonText_Click);
//Text button's click event
void ButtonText_Click(object sender, EventArgs e)
{
//The contents of the event
}
//* When using annotation functions, the following property must be set to True.
ImageKit1.Edit.EditEnabled = true;
//Change the button image of "PasteImage object"
toolBarAnnotation1.ButtonImage.ImageTransparentColor = Color.Magenta;
toolBarAnnotation1.ButtonImage.Image = Image.FromFile("\\img.bmp");
//Clear the contents
toolBarAnnotation1.Items.Clear();
//Create a ToolStripItem to use only some buttons and place them in a different order
ToolStripItem[] items = new ToolStripItem[] {
toolBarAnnotation1.ButtonImage,
toolBarAnnotation1.ButtonRectangle,
toolBarAnnotation1.ButtonText,
toolBarAnnotation1.ButtonSelect,
toolBarAnnotation1.ButtonDelete,
toolBarAnnotation1.ButtonProperties
};
//In the toolbar the order of button configuration and arrangement as set above
toolBarAnnotation1.Items.AddRange(items);
//Get click event for text button
toolBarAnnotation1.ButtonText.Click += new EventHandler(ButtonText_Click);
//Text button's click event
void ButtonText_Click(object sender, EventArgs e)
{
//The contents of the event
}
Relevant Properties
ToolBarAnnotation.ButtonImage
Refer here for all other toolbar button properties and related
properties,
ToolBarStandard
Members
ToolBarAnnotation
Members
ToolBarSetupLines
Members
ToolBarSetupObjects
Members