Handle the KeyPress event of the TextBox. If you try to handle it in the KeyDown event, you'll get an annoying system beep.
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles _
TextBox1.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
DoSomething();
'This tells the system not to process
'the key, as you've already taken care
'of it
e.Handled = True
End If
End Sub
: How can I make the program do something when a person presses enter after pressing the Enter key on the keyboard? What does the textbox need to handle a Enter key press event?
:
: Thanx
: