Special combination of edit box and bitmap button

Source: Internet
Author: User

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!

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.