00 Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
02 If KeyCode = KeyCodeConstants.vbKeyReturn Then
03 'TODO: Add your code here or call the required sub
04
05 'Example:
06 MsgBox "welcome in vb world!", vbOKOnly Or vbInformation
07 End If
08 End Sub
That will execute the associated sub or code when the KeyUp event got triggered; i.e. when the enter key gos up. To execute the action when the key is down, just change the KeyUp word to KeyDown, that will execute the code whenever the KeyDown event is triggered.
Thanks.
EDIT
Oh, all these answers, lol
Stick to "Hello There" answer, his answer is totally correct.
My answer is for vb 6, you know, you didn't tell which version you are talking abouat.
Thanks.