If you want to press enter in a textbox - see below - vb.net
Let's say that button2 has the code you want to call - by pressing enter in a textbox
This is an easy way to do it
notice - Textbox1_keydown
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If (e.KeyCode = Keys.Enter) Then Button2.PerformClick()
End Sub