How do i activevate a command boutton using (as an example) Enter/Return ? Hope ya' all got that... :)
Printable View
How do i activevate a command boutton using (as an example) Enter/Return ? Hope ya' all got that... :)
If you just want to activate it in your program just do:
VB Code:
form1.command1.value = true
I want the program too do an action when the user presses Enter/Return in this case use a command button
VB Code:
Command1.default = true
This will set the Command1 as default, when u hit Enter, your code wil be executed
Thanks just what i wanted thanks... Both of ya ;)
Just to add to that you can also set cancel to true and this means the click event fires when you press ESC. You cannot use both for the same button though.
Actually you can... but it might not be what you want.Quote:
Originally posted by -=XQ=-
Just to add to that you can also set cancel to true and this means the click event fires when you press ESC. You cannot use both for the same button though.
Or maybe it is.... you can have a command that says "Exit" set as Default and Cancel to unload the form even if you press Enter or Esc.