Hi Everyone, How can I tell if a user pressed the "enter" key?
You capture the event in the KeyDown or KeyPress event. Using a textbox as an example: 1 Code: Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then End If End Sub
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles TextBox1.KeyDown If e.KeyCode = Keys.Enter Then End If End Sub
Stim Free VB.NET Book Chapter Visual Basic 2005 Cookbook Sample Chapter
thanks stimbo. that works perfectly.
Forum Rules