Therefore, we have enough time within this element to influence the user input before it is displayed. This event is triggered at each keypress in the Edit and passes the pressed key within the variable Key as Char even before the keystroke reaches the Edit. procedure TForm1.Edit1KeyPress(Sender: TObject var Key: Char) The simplest method is to just use the OnKeyPress-Event of your Edit field. In this tutorial, I want to show you, how you can easily realize this behavior in Delphi or Lazarus. ![]() The user should only be allowed to type the digits 0 till 9 while letters or other characters should be rejected. Sometimes it may be necessary, that you only want numerical input in an Edit box.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |