Kevin007
September 13th, 1999, 04:52 PM
I have a simple program. I have one text box and one label control, if I type in some number in the text box then click OK button it will give me some character. I want the user to be able to press ENTER key after type in the number in the text box. then it will trigger OK button. How am I gonna do that????
Rufus
September 13th, 1999, 07:15 PM
In the KeyPress event for the text box write the following:
If KeyAscii = 13 Then
Call cmdCommand1_Click()
End If
Call the name of your Ok buttons Click event...
KeyAscii 13 is the Enter key...
Crazy D @ Work
September 14th, 1999, 01:38 AM
You can also set the default property of the command button to true, that way you don't have to do anything to let the command button catch the enter
Crazy D @ Work :-)