How to catch return hit (enter) on TextBox?
The following does not work. I am keep getting error “KeyPress event can’t be found”.
Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress
If TextBox.Text Is Nothing Then Return
If TextBox.Text.Length = 6 And Asc(e.KeyChar) = 13 Then
' Do something here
End If
End Sub
The following code does work: