Sunday, August 2, 2009

Using Visual Basic .NET how do you make a text box perform a function when enter is struck?

I want to be able to type something into the text box, hit enter, and watch as it does whatever it would have done had I clicked the button beneath it. Isn't there a really easy way to do this? I asked this about JavaScript before and still don't know how to do it with either.

Using Visual Basic .NET how do you make a text box perform a function when enter is struck?
i cant understand exactly what u mean but





Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp


If e.KeyCode = Keys.Enter Then


'do sth


End If


End Sub


No comments:

Post a Comment