How to press a button with the enter key
10,610
Set the button's Default property to True
from Object Inspector.
Related videos on Youtube
Author by
J Bom
Updated on April 01, 2020Comments
-
J Bom about 4 years
I have simple question. How do you press a button with your enter key?
I have a login screen, where I can just login with a button. But I also want to login when pressing the enter button.
How should I do this?
Thanks in advance!
Jasper
-
Andreas Rejbrand about 13 yearsYou should also know that the
Cancel
property will make the button respond to the Escape key. In a dialog box with one OK button and one Cancel button, you most often set the OK button toDefault := true
and the Cancel button toCancel := true
. In addition, the modal results should beModalResult := mrOK
andModalResult := mrCancel
, respectively.
-
-
J Bom about 13 yearsWhere can I do that? Cause I have no idea?
-
Cosmin Prund about 13 yearsYou select the button you want activated with the Enter key (probably an
Ok
orLogIn
button), you go to your Object Inspector, find theDefault
property and selectTrue
.