On Thu, Aug 18, 2011 at 04:55, John Dammeyer <jo...@autoartisans.com> wrote: > I'm using a Tedit form for entering a string of characters. I want the > ENTER key to call a button ONCLICK event. That all works. The problem is > the ENTER key also rings the bell on Windows. > > How do I prevent the bell from ringing. I'm guessing it's because the > ENTER key is considered an invalid input. How do I add the ENTER key to > be a valid input so it doesn't bing the bell?
Hi, try setting Key to #0, like this: procedure TM_Login.Edit_UserKeyPress( Sender: TObject; var Key: Char ); begin // Enter pressed if (Key = #13) then begin // do something ..... // ...... Key := #0; Edit_Pass.SetFocus; end; end; end; _______________________________________________ Delphi mailing list Delphi@elists.org http://lists.elists.org/cgi-bin/mailman/listinfo/delphi