This property sets or retrieves the "BackColor" button of the ToolBarStandard control.
Property Value
A value of type System.Windows.Forms.ToolStripButton
Explanation
The ButtonBackColor property sets or retrieves the "BackColor" button of the ToolBarStandard. The "BackColor" button is a ToolStripButton control. By using the ButtonBackColor property, you can change "BackColor" button settings, generate events, etc. See code examples below.
Examples
(1) To change the image displayed in the "Fill" button
ToolBarStandard1.ButtonFill.Image = Image.FromFile("c:\images\button_img1.bmp")
[Visual C#.NET]
ToolBarStandard1.Fill.Image = Image.FromFile("c:\\images\\button_img1.bmp");
(2) To retrieve the "PenWidthUp" button click event
* It is necessary to determine which button was clicked. This must
be done within the ToolBarStandard control's ItemClicked event
Private Sub ToolBarStandard1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolBarStandard1.ItemClicked
If e.ClickedItem Is ToolBarStandard1.ButtonPenWidthUp Then 'The button clicked was the "PenWidthUp" button
'Here is where you place code that will be executed when this event fires
End If
End Sub
[Visual C#.NET]
private void ToolBarStandard1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem == ToolBarStandard1.ButtonPenWidthUp) //The button clicked was the "PenWidthUp" button
{
//Here is where you place code that will be executed when this event fires
}
}
(3) To generate the "PenWidthUp" button mouse up event
'* In the FormLoad or other event, set the delegate for the ButtonPenWidthUp mouse up event.
AddHandler ToolBarStandard1.ButtonPenWidthUp.MouseUp, AddressOf ButtonPenWidthUp_MouseUp
'Event Handler Delegate
Private Sub ButtonPenWidthUp_MouseUp(ByVal sender As System.Object, ByVal e As System.EventArgs)
'Here is where you place code that will be executed when this event fires
End Sub
[Visual C#.NET]
'* In the FormLoad or other event, set the delegate for the ButtonPenWidthUp mouse up event.
ToolBarStandard1.ButtonPenWidthUp.MouseUp += new MouseEventHandler(ButtonPenWidthUp_MouseUp);
//Event Handler Delegate
private void ButtonPenWidthUp_MouseUp(object sender, EventArgs e)
{
//Here is where you place code that will be executed when this event fires
}
See Also
ToolBarStandard Members | Newtone.ImageKit.Win.ToolBarStandard