Processing data from a textbox

couly

New member
Joined
Mar 26, 2010
Messages
4
Programming Experience
10+
Hi,
Is there an easy way of trapping the enter key in a textbox to process the data, instead of having a button beside it?
 
VB.NET:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
   'do whatever
End If
End Sub
 
Back
Top