mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* 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
1.8 KiB
1.8 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| Designate a Button as the Cancel Button | 03/30/2017 |
|
|
252f0834-e54b-44d9-96f7-ee5f50e94f2c |
How to: Designate a Windows Forms Button as the Cancel Button
On any Windows Form, you can designate a xref:System.Windows.Forms.Button control to be the cancel button. A cancel button is clicked whenever the user presses the ESC key, regardless of which other control on the form has the focus. Such a button is usually programmed to enable the user to quickly exit an operation without committing to any action.
To designate the cancel button
-
Set the form's xref:System.Windows.Forms.Form.CancelButton%2A property to the appropriate xref:System.Windows.Forms.Button control.
Private Sub SetCancelButton(ByVal myCancelBtn As Button) Me.CancelButton = myCancelBtn End Subprivate void SetCancelButton(Button myCancelBtn) { this.CancelButton = myCancelBtn; }private: void SetCancelButton(Button ^ myCancelBtn) { this->CancelButton = myCancelBtn; }