:confused:
Printable View
:confused:
you mean if it's pressed in the textbox ??
yeah, it's basically a follow on from the all of the sudden... thread, you type something into a textbox, press return and I want to capture that so I can do something.
you seem so busy
if that what you mean then check this :
:DVB Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As _ System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Asc(e.KeyChar()) = 13 Then MsgBox("You Pressed Enter Key") ' put your code here End If End Sub
two posts at the same time :D
I get a blue squiggle under e.KeyChar and it tells me that 'KeyChar' is not a member of 'System.EventArgs'. Does something need declaring?
that code should go under the KeyPress EVENT .
Yeah, your right. When I double-clicked on the textbox to get the code, it gave me this:
and I assumed that would be ok. But what do I know, pah :rolleyes:VB Code:
Private Sub txtUserInput_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUserInput.TextChanged End Sub
in the code editor click the first code on the top left "Class Name" scroll down and select your textbox then on the right combobox scroll down to KeyPress event , click it , write your code there .Done !;)
THANK YOU!!!! I wondered how to change the arguments of various controls and it never occured to me to change the class name from the top left pull down, doh!!
:D :D :D :D :D :D :D
:cool: :D ;)
...and I call myself a VB programmer! :eek: :p