Special combination of edit box and bitmap button
Special combination of edit box and bitmap button
Delphi programming has become a hot topic in modern programming. Many programmers prefer to use delphi to write programs. You may encounter many unexpected problems in delphi programming. Now I will share my experience in programming with you for your reference: create a form form1 and create edit1 on the form, edit2: Two editing boxes, bitbtn1: a bitmap button. The text attribute of edit1 and edit2 is null. The keypress segment of edit1 is written as: If key = #13 then edit2.text: = 'edit1 valid ', write edit2.text: = 'edit1 invalid' In The onclick program segment of bitbtn1. when running the program, press enter in the edit1 edit box, and "edit1 valid" is displayed in the edit2 edit box. Press the bitbtn1 button, "edit1 is invalid" is displayed in the edit2 edit box ". After completing the preceding operations, select bkok In the kind attribute card of bitbtn1 (bitbtn1), a green check sign will appear on bitbtn1, and press enter on edit1, there is a special situation: "edit1 is invalid" is displayed in the edit2 editing box, which is the command executed by the bitbtn1 button, and the command in edit1 is invalid. No matter what commands or program segments you set in keypress in the edit1 edit box do not work, the commands in the bitbtn1 button are automatically executed when you press enter to confirm. Sometimes, in order to make the interface friendly, you will change the kind attribute of the bitmap button, which will invalidate the keypress program segment of all the edit boxes on the same form. When you press enter in the edit box, the bitmap button onclick command is executed! Readers may wish to give it a try to avoid timely correction when similar situations occur in programming!