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!