If you ever wanted to capture the key Enter on a text box, here is the code
Private Sub txtsearch_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtsearch.KeyPressThe best method i found is to create a sub process and call it from both of your codes. Both codes i mean the button that you press the Enter key and the button that you have to handle the user input
If Asc(e.KeyChar) = 13 Then
'Your code goes here...
End If
End Sub
No comments:
Post a Comment