Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/ways-to-select-a-windows-forms-button-control.md
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

1.5 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
Ways to Select a Button Control 03/30/2017
Button control [Windows Forms], selecting
fe2fc058-5118-4f70-b264-6147d64a7a8d

Ways to Select a Windows Forms Button Control

A Windows Forms button can be selected in the following ways:

  • Use a mouse to click the button.

  • Invoke the button's xref:System.Windows.Forms.Control.Click event in code.

  • Move the focus to the button by pressing the TAB key, and then choose the button by pressing the SPACEBAR or ENTER.

  • Press the access key (ALT + the underlined letter) for the button. For more information about access keys, see How to: Create Access Keys for Windows Forms Controls.

  • If the button is the "accept" button of the form, pressing ENTER chooses the button, even if another control has the focus — except if that other control is another button, a multi-line text box, or a custom control that traps the enter key.

  • If the button is the "cancel" button of the form, pressing ESC chooses the button, even if another control has the focus.

  • Call the xref:System.Windows.Forms.Button.PerformClick%2A method to select the button programmatically.

See also