/
ToolBarButtonClickEventHandler.xml
47 lines (41 loc) · 3.6 KB
/
ToolBarButtonClickEventHandler.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<Type Name="ToolBarButtonClickEventHandler" FullName="System.Windows.Forms.ToolBarButtonClickEventHandler">
<TypeSignature Language="C#" Value="public delegate void ToolBarButtonClickEventHandler(object sender, ToolBarButtonClickEventArgs e);" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed ToolBarButtonClickEventHandler extends System.MulticastDelegate" />
<TypeSignature Language="DocId" Value="T:System.Windows.Forms.ToolBarButtonClickEventHandler" />
<TypeSignature Language="VB.NET" Value="Public Delegate Sub ToolBarButtonClickEventHandler(sender As Object, e As ToolBarButtonClickEventArgs)" />
<TypeSignature Language="F#" Value="type ToolBarButtonClickEventHandler = delegate of obj * ToolBarButtonClickEventArgs -> unit" />
<TypeSignature Language="C++ CLI" Value="public delegate void ToolBarButtonClickEventHandler(System::Object ^ sender, ToolBarButtonClickEventArgs ^ e);" />
<AssemblyInfo>
<AssemblyName>System.Windows.Forms</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="sender" Type="System.Object" />
<Parameter Name="e" Type="System.Windows.Forms.ToolBarButtonClickEventArgs" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Docs>
<param name="sender">The source of the event.</param>
<param name="e">A <see cref="T:System.Windows.Forms.ToolBarButtonClickEventArgs" /> that contains the event data.</param>
<summary>Represents the method that will handle the <see cref="E:System.Windows.Forms.ToolBar.ButtonClick" /> event of a <see cref="T:System.Windows.Forms.ToolBar" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you create a <xref:System.Windows.Forms.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](/dotnet/standard/events/).
## Examples
The following example instantiates a <xref:System.Windows.Forms.ToolBar> and three <xref:System.Windows.Forms.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 <xref:System.Windows.Forms.ToolBar.ButtonClick> event of the toolbar, the <xref:System.Windows.Forms.ToolBarButtonClickEventArgs.Button%2A> property of the <xref:System.Windows.Forms.ToolBarButtonClickEventArgs> is evaluated, and the appropriate dialog opened. This code assumes that a <xref:System.Windows.Forms.Form>, an <xref:System.Windows.Forms.OpenFileDialog>, a <xref:System.Windows.Forms.SaveFileDialog>, and a <xref:System.Windows.Forms.PrintDialog> have been instantiated.
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic ToolBar.ToolBar Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolBar/Overview/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic ToolBar.ToolBar Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Forms.ToolBarButtonClickEventArgs" />
</Docs>
</Type>