I
Imran Koradia
If you want to test in a textbox, you could do it this way:
Private Sub TextBox1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
MessageBox.Show("enter!")
End If
End Sub
If you want to test on the entire form, set the form's KeyPreview property
to True and then handle the KeyDown event of the form just as the textbox as
above.
hope that helps..
Imran.
Private Sub TextBox1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
MessageBox.Show("enter!")
End If
End Sub
If you want to test on the entire form, set the form's KeyPreview property
to True and then handle the KeyDown event of the form just as the textbox as
above.
hope that helps..
Imran.