C # The "enter" function of the winfrom page is changed to "tab". How can I continue using the "enter" function in a specific button !! Urgent,

Source: Internet
Author: User

C # The "enter" function of the winfrom page is changed to "tab". How can I continue using the "enter" function in a specific button !! Urgent,

Enter is implemented when the tab key is used: for example, when you press enter, the switch continues, go to a button and ask the enter key to execute the enter button instead of the tab,

The code for changing the tab function to enter is as follows:
Protected override bool ProcessCmdKey (ref System. Windows. Forms. Message msg, System. Windows. Forms. Keys keyData)
{

If (msg. WParam. ToInt32 () = (int) Keys. Enter)
{

SendKeys. Send ("{Tab }");

Return true;

}

Return base. ProcessCmdKey (ref msg, keyData );

}

However, whether the "enter" function is executed at the specified position can help you solve the problem,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.