Mega Code Archive

 
Categories / Delphi / Examples
 

How do i stop my tedit control beeping

If a user hits the enter key in a TEdit box, he is 'rewarded' with an annoying beep. To avoid this, set KeyPreview := True for the form and capture the enter key in the OnKeyPress form event. If the sender is the editbox, you now can process the return and change it to something else like null before the editbox sees it.