ToolBarButtonClickEventHandler Delegate
Represents the method that will handle the ButtonClick event of a ToolBar.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
type ToolBarButtonClickEventHandler = delegate of sender:Object * e:ToolBarButtonClickEventArgs -> unit
Parameters
- sender
-
Type:
System.Object
The source of the event.
- e
-
Type:
System.Windows.Forms.ToolBarButtonClickEventArgs
A ToolBarButtonClickEventArgs that contains the event data.
When you create a ToolBarButtonClickEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about handling events with delegates, see Handling and Raising Events.
The following example instantiates a ToolBar and three ToolBarButton controls. The toolbar buttons are assigned to the button collection, the collection is assigned to the toolbar, and the toolbar is added to the form. On the ButtonClick event of the toolbar, the Button property of the ToolBarButtonClickEventArgs is evaluated, and the appropriate dialog opened. This code assumes that a Form, an OpenFileDialog, a SaveFileDialog, and a PrintDialog have been instantiated.
Available since 1.1