Special combination of edit box and bitmap button

Source: Internet
Author: User
Tags valid

Special combination of edit box and bitmap button

Delphi programming has become a popular modern programming, many programmers like to use Delphi to write programs. Can be in the Delphi programming, will encounter many unexpected problems, now I encountered in the programming experience for everyone's reference: Create a new Form Form1, create edit1,edit2 two edit boxes on the form, bitbtn1 a bitmap button, Edit1, The Edit2 Text property is empty and is written in the Edit1 keypress program segment: If key= #13 then edit2.text:= ' edit1 valid ', BITBTN1 's onclick program segment writes: Edit2.text:= ' Edit1 is invalid ', when you run the program, press ENTER in the Edit1 edit box, the Edit2 edit box displays "edit1 valid", press the BITBTN1 button, and the Edit2 edit box displays "Edit1 is invalid." When you are done, select Bkok in the Kind property card of the BITBTN1 (bitmap button), then a green checkmark appears on the BITBTN1, and when you press ENTER on the edit1, a special situation occurs: The Edit2 edit box displays "Edit1 invalid", This is exactly the command that the BITBTN1 button is executing, and the command in Edit1 is invalid. No matter what command or program section you set in the Edit1 edit box, it does not work, and automatically executes the commands in the BITBTN1 button when the carriage return is confirmed. Sometimes, to make the interface friendly, you will change the bitmap button's Kind property, which will cause all edit edit boxes on the same form to keypress the program section, when you enter the edit box, will execute the bitmap button onclick command! Readers may wish to try to avoid in the programming of similar situations, can be corrected in time!

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.