1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="Button" FullName="System.Windows.Forms.Button">
3 <TypeSignature Language="C#" Value="public class Button : System.Windows.Forms.ButtonBase, System.Windows.Forms.IButtonControl" />
5 <AssemblyName>System.Windows.Forms</AssemblyName>
6 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
7 <AssemblyVersion>2.0.0.0</AssemblyVersion>
10 <BaseTypeName>System.Windows.Forms.ButtonBase</BaseTypeName>
14 <InterfaceName>System.Windows.Forms.IButtonControl</InterfaceName>
19 <attribution license="cc4" from="Microsoft" modified="false" />
20 <para>A <see cref="T:System.Windows.Forms.Button" /> can be clicked by using the mouse, ENTER key, or SPACEBAR if the button has focus.</para>
21 <para>Set the <see cref="P:System.Windows.Forms.Form.AcceptButton" /> or <see cref="P:System.Windows.Forms.Form.CancelButton" /> property of a <see cref="T:System.Windows.Forms.Form" /> to allow users to click a button by pressing the ENTER or ESC keys even if the button does not have focus. This gives the form the behavior of a dialog box.</para>
22 <para>When you display a form using the <see cref="M:System.Windows.Forms.Form.ShowDialog" /> method, you can use the <see cref="P:System.Windows.Forms.Button.DialogResult" /> property of a button to specify the return value of <see cref="M:System.Windows.Forms.Form.ShowDialog" />.</para>
23 <para>You can change the button's appearance. For example, to make it appear flat for a Web look, set the <see cref="P:System.Windows.Forms.ButtonBase.FlatStyle" /> property to <see cref="F:System.Windows.Forms.FlatStyle.Flat" />. The <see cref="P:System.Windows.Forms.ButtonBase.FlatStyle" /> property can also be set to <see cref="F:System.Windows.Forms.FlatStyle.Popup" />, which appears flat until the mouse pointer passes over the button; then the button takes on the standard Windows button appearance.</para>
24 <block subset="none" type="note">
25 <para>If the control that has focus accepts and processes the ENTER key press, the <see cref="T:System.Windows.Forms.Button" /> does not process it. For example, if a multiline <see cref="T:System.Windows.Forms.TextBox" /> or another button has focus, that control processes the ENTER key press instead of the accept button.</para>
29 <attribution license="cc4" from="Microsoft" modified="false" />
30 <para>Represents a Windows button control.</para>
34 <Member MemberName=".ctor">
35 <MemberSignature Language="C#" Value="public Button ();" />
36 <MemberType>Constructor</MemberType>
40 <attribution license="cc4" from="Microsoft" modified="false" />
41 <para>By default the <see cref="T:System.Windows.Forms.Button" /> displays no caption. To specify the caption text, set the <see cref="P:System.Windows.Forms.Control.Text" /> property.</para>
44 <attribution license="cc4" from="Microsoft" modified="false" />
45 <para>Initializes a new instance of the <see cref="T:System.Windows.Forms.Button" /> class.</para>
49 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
50 <AssemblyVersion>2.0.0.0</AssemblyVersion>
53 <Member MemberName="AutoSizeMode">
54 <MemberSignature Language="C#" Value="public System.Windows.Forms.AutoSizeMode AutoSizeMode { set; get; }" />
55 <MemberType>Property</MemberType>
57 <AssemblyVersion>2.0.0.0</AssemblyVersion>
61 <AttributeName>System.ComponentModel.DefaultValue(System.Windows.Forms.AutoSizeMode.GrowOnly)</AttributeName>
64 <AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
67 <AttributeName>System.ComponentModel.Browsable(true)</AttributeName>
71 <ReturnType>System.Windows.Forms.AutoSizeMode</ReturnType>
74 <value>To be added.</value>
75 <remarks>To be added.</remarks>
77 <attribution license="cc4" from="Microsoft" modified="false" />
78 <para>Gets or sets the mode by which the <see cref="T:System.Windows.Forms.Button" /> automatically resizes itself.</para>
82 <Member MemberName="CreateParams">
83 <MemberSignature Language="C#" Value="protected override System.Windows.Forms.CreateParams CreateParams { get; }" />
84 <MemberType>Property</MemberType>
86 <ReturnType>System.Windows.Forms.CreateParams</ReturnType>
89 <value>To be added.</value>
91 <attribution license="cc4" from="Microsoft" modified="false" />
92 <para>Inheriting classes can override this property to add extra functionality, but must first call the <see cref="T:System.Windows.Forms.CreateParams" /> constructor on the base class to verify that the control continues to work correctly.</para>
95 <attribution license="cc4" from="Microsoft" modified="false" />
96 <para>Gets a <see cref="T:System.Windows.Forms.CreateParams" /> on the base class when creating a window. </para>
100 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
101 <AssemblyVersion>2.0.0.0</AssemblyVersion>
104 <Member MemberName="DialogResult">
105 <MemberSignature Language="C#" Value="public virtual System.Windows.Forms.DialogResult DialogResult { set; get; }" />
106 <MemberType>Property</MemberType>
109 <AttributeName>System.ComponentModel.DefaultValue(System.Windows.Forms.DialogResult.None)</AttributeName>
113 <ReturnType>System.Windows.Forms.DialogResult</ReturnType>
116 <value>To be added.</value>
118 <attribution license="cc4" from="Microsoft" modified="false" />
119 <para>If the <see cref="T:System.Windows.Forms.DialogResult" /> for this property is set to anything other than None, and if the parent form was displayed through the <see cref="M:System.Windows.Forms.Form.ShowDialog" /> method, clicking the button closes the parent form without your having to hook up any events. The form's <see cref="P:System.Windows.Forms.Form.DialogResult" /> property is then set to the <see cref="T:System.Windows.Forms.DialogResult" /> of the button when the button is clicked.</para>
120 <para>For example, to create a "Yes/No/Cancel" dialog box, simply add three buttons and set their <see cref="T:System.Windows.Forms.DialogResult" /> properties to Yes, No, and Cancel.</para>
123 <attribution license="cc4" from="Microsoft" modified="false" />
124 <para>Gets or sets a value that is returned to the parent form when the button is clicked.</para>
128 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
129 <AssemblyVersion>2.0.0.0</AssemblyVersion>
132 <Member MemberName="DoubleClick">
133 <MemberSignature Language="C#" Value="public event EventHandler DoubleClick;" />
134 <MemberType>Event</MemberType>
137 <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
140 <AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
144 <ReturnType>System.EventHandler</ReturnType>
148 <attribution license="cc4" from="Microsoft" modified="false" />
149 <para>By default, the <see cref="F:System.Windows.Forms.ControlStyles.StandardClick" /> and <see cref="F:System.Windows.Forms.ControlStyles.StandardDoubleClick" /> style bits are set to false for the <see cref="T:System.Windows.Forms.Button" /> control, and the <see cref="E:System.Windows.Forms.Button.DoubleClick" /> event is not raised. </para>
150 <para>For more information about handling events, see <format type="text/html"><a href="01e4f1bc-e55e-413f-98c7-6588493e5f67">Consuming Events</a></format>. </para>
153 <attribution license="cc4" from="Microsoft" modified="false" />
154 <para>Occurs when the user double-clicks the <see cref="T:System.Windows.Forms.Button" /> control.</para>
158 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
159 <AssemblyVersion>2.0.0.0</AssemblyVersion>
162 <Member MemberName="MouseDoubleClick">
163 <MemberSignature Language="C#" Value="public event System.Windows.Forms.MouseEventHandler MouseDoubleClick;" />
164 <MemberType>Event</MemberType>
166 <AssemblyVersion>2.0.0.0</AssemblyVersion>
170 <AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)</AttributeName>
173 <AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
177 <ReturnType>System.Windows.Forms.MouseEventHandler</ReturnType>
181 <attribution license="cc4" from="Microsoft" modified="false" />
182 <para>By default, the <see cref="F:System.Windows.Forms.ControlStyles.StandardClick" /> and <see cref="F:System.Windows.Forms.ControlStyles.StandardDoubleClick" /> style bits are set to false for the <see cref="T:System.Windows.Forms.Button" /> control, and the <see cref="E:System.Windows.Forms.Button.MouseDoubleClick" /> event is not raised.</para>
183 <para>For more information about handling events, see <format type="text/html"><a href="01e4f1bc-e55e-413f-98c7-6588493e5f67">Consuming Events</a></format>. </para>
186 <attribution license="cc4" from="Microsoft" modified="false" />
187 <para>Occurs when the user double-clicks the <see cref="T:System.Windows.Forms.Button" /> control with the mouse.</para>
191 <Member MemberName="NotifyDefault">
192 <MemberSignature Language="C#" Value="public virtual void NotifyDefault (bool value);" />
193 <MemberType>Method</MemberType>
195 <ReturnType>System.Void</ReturnType>
198 <Parameter Name="value" Type="System.Boolean" />
202 <attribution license="cc4" from="Microsoft" modified="false" />
203 <para>This method is called by the parent form to notify the <see cref="T:System.Windows.Forms.Button" /> that it should be set as the default button and to allow it to adjust its appearance accordingly. Typically, a button that is the default button for a form has a thicker border than other buttons on the form.</para>
204 <para>Calling the <see cref="M:System.Windows.Forms.Button.NotifyDefault(System.Boolean)" /> method only draws the button as a default button; it does not change its behavior. To make the button behave like a default button, it must be assigned to the <see cref="P:System.Windows.Forms.Form.AcceptButton" /> property of the <see cref="T:System.Windows.Forms.Form" />.</para>
207 <attribution license="cc4" from="Microsoft" modified="false" />
208 <para>Notifies the <see cref="T:System.Windows.Forms.Button" /> whether it is the default button so that it can adjust its appearance accordingly.</para>
211 <attribution license="cc4" from="Microsoft" modified="false" />true if the button is to have the appearance of the default button; otherwise, false. </param>
214 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
215 <AssemblyVersion>2.0.0.0</AssemblyVersion>
218 <Member MemberName="OnClick">
219 <MemberSignature Language="C#" Value="protected override void OnClick (EventArgs e);" />
220 <MemberType>Method</MemberType>
222 <ReturnType>System.Void</ReturnType>
225 <Parameter Name="e" Type="System.EventArgs" />
228 <param name="e">To be added.</param>
229 <summary>To be added.</summary>
230 <remarks>To be added.</remarks>
233 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
234 <AssemblyVersion>2.0.0.0</AssemblyVersion>
237 <Member MemberName="OnFontChanged">
238 <MemberSignature Language="C#" Value="protected override void OnFontChanged (EventArgs e);" />
239 <MemberType>Method</MemberType>
241 <AssemblyVersion>2.0.0.0</AssemblyVersion>
244 <ReturnType>System.Void</ReturnType>
247 <Parameter Name="e" Type="System.EventArgs" />
251 <attribution license="cc4" from="Microsoft" modified="false" />
252 <para>Raising an event invokes the event handler through a delegate. For more information, see <format type="text/html"><a href="f2adaf01-1ed1-42e1-8c31-8d467e7e0ee2">Raising an Event</a></format>.</para>
253 <para>The <see cref="M:System.Windows.Forms.Button.OnFontChanged(System.EventArgs)" /> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.</para>
256 <attribution license="cc4" from="Microsoft" modified="false" />
257 <para>Raises the <see cref="E:System.Windows.Forms.Control.FontChanged" /> event.</para>
260 <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.EventArgs" /> that contains the event data. </param>
263 <Member MemberName="OnMouseEnter">
264 <MemberSignature Language="C#" Value="protected override void OnMouseEnter (EventArgs e);" />
265 <MemberType>Method</MemberType>
267 <ReturnType>System.Void</ReturnType>
270 <Parameter Name="e" Type="System.EventArgs" />
273 <summary>To be added.</summary>
274 <remarks>To be added.</remarks>
275 <since version=".NET 2.0" />
277 <attribution license="cc4" from="Microsoft" modified="false" />Provides information for the event.</param>
280 <AssemblyVersion>2.0.0.0</AssemblyVersion>
283 <Member MemberName="OnMouseLeave">
284 <MemberSignature Language="C#" Value="protected override void OnMouseLeave (EventArgs e);" />
285 <MemberType>Method</MemberType>
287 <ReturnType>System.Void</ReturnType>
290 <Parameter Name="e" Type="System.EventArgs" />
293 <summary>To be added.</summary>
294 <remarks>To be added.</remarks>
295 <since version=".NET 2.0" />
297 <attribution license="cc4" from="Microsoft" modified="false" />Provides missing information for the event.</param>
300 <AssemblyVersion>2.0.0.0</AssemblyVersion>
303 <Member MemberName="OnMouseUp">
304 <MemberSignature Language="C#" Value="protected override void OnMouseUp (System.Windows.Forms.MouseEventArgs mevent);" />
305 <MemberType>Method</MemberType>
307 <ReturnType>System.Void</ReturnType>
310 <Parameter Name="mevent" Type="System.Windows.Forms.MouseEventArgs" />
314 <attribution license="cc4" from="Microsoft" modified="false" />
315 <para>Raising an event invokes the event handler through a delegate. For more information, see <format type="text/html"><a href="f2adaf01-1ed1-42e1-8c31-8d467e7e0ee2">Raising an Event</a></format>.</para>
316 <para>The <see cref="M:System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.</para>
319 <attribution license="cc4" from="Microsoft" modified="false" />
320 <para>Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnMouseUp(System.Windows.Forms.MouseEventArgs)" /> event.</para>
322 <param name="mevent">
323 <attribution license="cc4" from="Microsoft" modified="false" />A <see cref="T:System.Windows.Forms.MouseEventArgs" /> that contains the event data. </param>
326 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
327 <AssemblyVersion>2.0.0.0</AssemblyVersion>
330 <Member MemberName="OnTextChanged">
331 <MemberSignature Language="C#" Value="protected override void OnTextChanged (EventArgs e);" />
332 <MemberType>Method</MemberType>
334 <ReturnType>System.Void</ReturnType>
337 <Parameter Name="e" Type="System.EventArgs" />
340 <since version=".NET 2.0" />
342 <attribution license="cc4" from="Microsoft" modified="false" />
343 <para>Raising an event invokes the event handler through a delegate. For more information, see <format type="text/html"><a href="f2adaf01-1ed1-42e1-8c31-8d467e7e0ee2">Raising an Event</a></format>.</para>
344 <para>The <see cref="M:System.Windows.Forms.Button.OnTextChanged(System.EventArgs)" /> method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.</para>
347 <attribution license="cc4" from="Microsoft" modified="false" />
348 <para>Raises the <see cref="E:System.Windows.Forms.Control.TextChanged" /> event. </para>
351 <attribution license="cc4" from="Microsoft" modified="false" />An <see cref="T:System.EventArgs" /> that contains the event data.</param>
354 <AssemblyVersion>2.0.0.0</AssemblyVersion>
357 <Member MemberName="PerformClick">
358 <MemberSignature Language="C#" Value="public void PerformClick ();" />
359 <MemberType>Method</MemberType>
361 <ReturnType>System.Void</ReturnType>
366 <attribution license="cc4" from="Microsoft" modified="false" />
367 <para>This method can be called to raise the <see cref="E:System.Windows.Forms.Control.Click" /> event.</para>
370 <attribution license="cc4" from="Microsoft" modified="false" />
371 <para>Generates a <see cref="E:System.Windows.Forms.Control.Click" /> event for a button.</para>
375 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
376 <AssemblyVersion>2.0.0.0</AssemblyVersion>
379 <Member MemberName="ProcessMnemonic">
380 <MemberSignature Language="C#" Value="protected override bool ProcessMnemonic (char charCode);" />
381 <MemberType>Method</MemberType>
383 <ReturnType>System.Boolean</ReturnType>
386 <Parameter Name="charCode" Type="System.Char" />
390 <attribution license="cc4" from="Microsoft" modified="false" />
391 <para>When overriding <see cref="M:System.Windows.Forms.Button.ProcessMnemonic(System.Char)" /> in a derived class, be sure to call the base class's <see cref="M:System.Windows.Forms.Button.ProcessMnemonic(System.Char)" /> to ensure that basic functionality remains unchanged.</para>
394 <attribution license="cc4" from="Microsoft" modified="false" />
395 <para>Processes a mnemonic character. </para>
398 <attribution license="cc4" from="Microsoft" modified="false" />
399 <para>true if the mnemonic was processed; otherwise, false.</para>
401 <param name="charCode">
402 <attribution license="cc4" from="Microsoft" modified="false" />The mnemonic character entered. </param>
405 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
406 <AssemblyVersion>2.0.0.0</AssemblyVersion>
409 <Member MemberName="ToString">
410 <MemberSignature Language="C#" Value="public override string ToString ();" />
411 <MemberType>Method</MemberType>
413 <ReturnType>System.String</ReturnType>
417 <summary>To be added.</summary>
418 <returns>To be added.</returns>
419 <remarks>To be added.</remarks>
422 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
423 <AssemblyVersion>2.0.0.0</AssemblyVersion>
426 <Member MemberName="WndProc">
427 <MemberSignature Language="C#" Value="protected override void WndProc (ref System.Windows.Forms.Message m);" />
428 <MemberType>Method</MemberType>
430 <ReturnType>System.Void</ReturnType>
433 <Parameter Name="m" Type="System.Windows.Forms.Message&" RefType="ref" />
436 <param name="m">To be added.</param>
437 <summary>To be added.</summary>
438 <remarks>To be added.</remarks>
441 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
442 <AssemblyVersion>2.0.0.0</AssemblyVersion>
448 <AttributeName>System.ComponentModel.Designer("System.Windows.Forms.Design.ButtonBaseDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")</AttributeName>
451 <AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
454 <AttributeName>System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)</AttributeName>