When you have entered the text box, it is the same as pressing the OK key! Use method collection for carriage returns

Source: Internet
Author: User
When you have finished typing in the text box, knocking in the carriage is the same as pressing the OK key. -------------Delphi Two methods: 1, in the onkeypress event to determine the return key; 2, respond to the OnValidate event in the text box. Where to find the key. It's the OK button on the interface. One method is to set the default property of the OK button to true so that pressing ENTER on the interface, except for the other buttons, executes the event that determines the button. Another method is to write in the onkeypress event of the text box: if key= #13 then Btn_okclick (Sender); BTN_OK is the OK button. The KeyPreview of the form is set to true; Edit1 onkeypress write: If key= #13 then begin key:= #0; Edit2. SetFocus end; ----------Java-------------the ability to log in by enter in the Password input box//------------C #---------------C # 's carriage return notation is similar to Javescript if (E.keychar ==13) {MessageBox ("carriage return corresponding Success ~ ~");}

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.