Use the textbox's KeyUp event and test to see if its the enter key that has been pressed. Example:
Visual Basic:
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
If (e.KeyData = Keys.Enter) Then MsgBox("Congratulations, you pressed enter!")
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.