This property sets or retrieves the "Clear All Objects" button of the ToolBarAnnotation control.

[Visual Basic]Public Property ButtonClearAll As System.Windows.Forms.ToolStripButton
[C#]public System.Windows.Forms.ToolStripButton ButtonClearAll {get; set;}

Property Value

A value of type System.Windows.Forms.ToolStripButton

Explanation

The ButtonClearAll property sets or retrieves the "Clear All Objects" button of the ToolBarAnnotation. The "Clear All Objects" button is a ToolStripButton control. By using the ButtonClearAll property, you can change "Clear All Objects" button settings, generate events, etc. See code examples below.

Examples

(1) To change the image displyed in the "Clear All Objects" button

[Visual Basic.NET]
     ToolBarAnnotation1.ButtonClearAll.Image = Image.FromFile("c:\images\button_img1.bmp")

[Visual C#.NET]
     toolBarAnnotation1.ButtonClearAll.Image = Image.FromFile("c:\\images\\button_img1.bmp");

(2) To retrieve the "Select" button click event
* It is necessary to determine which button was clicked. This must be done within the ToolBarAnnotation control's ItemClicked event

[Visual Basic.NET]
     Private Sub ToolBarAnnotation1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolBarAnnotation1.ItemClicked
          If e.ClickedItem Is ToolBarAnnotation1.ButtonSelect Then 'The button clicked was the "select" button
               'Here is where you place code that will be executed when this event fires
          End If
     End Sub

[Visual C#.NET]
     private void toolBarAnnotation1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
     {
          if (e.ClickedItem == toolBarAnnotation1.ButtonSelect) //The button clicked was the "select" button
          {
               //Here is where you place code that will be executed when this event fires
          }
     }

(3) To generate the "Select" button mouse up event

[Visual Basic.NET]
     '* In the FormLoad or other event, set the delegate for the ButtonSelect mouse up event.
     AddHandler ToolBarAnnotation1.ButtonSelect.MouseUp, AddressOf ButtonSelect_MouseUp

     'Event Handler Delegate
     Private Sub ButtonSelect_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 ButtonSelect mouse up event.
     toolBarAnnotation1.ButtonSelect.MouseUp += new MouseEventHandler(ButtonSelect_MouseUp);

     //Event Handler Delegate
     private void ButtonSelect_MouseUp(object sender, EventArgs e)
     {
          //Here is where you place code that will be executed when this event fires
     }

See Also

ToolBarAnnotation Members | Newtone.ImageKit.Win.ToolBarAnnotation

 

The ImageKit.NET3 is created by Newtone Corporation