In this post, we will discuss how to set Enter and Esc keys in C#.Net windows application. You can also check out my previous posts on:
Suppose I have a Windows Form and two buttons name as btnEnter and btnEsc. I want when the user clicks on entering, btnEnter should respond and similarly when the user clicks on Esc, btnEsc should respond.
Set Enter Key:
For this Open windows form properties, from the properties window, select btnEnter in the AcceptButton properties as shown in the fig below:
Set Esc Key:
For this Open windows form properties, from the properties window, select btnEsc in the CancelButton properties as shown in the fig below:
After that when you open the form, click on Enter key, btnEnter will fire and if you click on Esc, btnEsc code will fire.
You May Also like the Following SharePoint Online Tutorials:
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.