How can I make my text box send the value that was entered when pressing the key "Enter"? I have tried the "textbox_enter" event and it wouldn't work. When I press enter it makes a noise (something like "ding" xD). Can anyone help me?
How can I make the key enter close and send what was typed in to a texHow to send a value when pressing enter.
Page 1 of 1
4 Replies - 1225 Views - Last Post: 03 September 2009 - 04:27 PM
#1
How can I make the key enter close and send what was typed in to a tex
Posted 02 September 2009 - 08:17 PM
Replies To: How can I make the key enter close and send what was typed in to a tex
#2
Re: How can I make the key enter close and send what was typed in to a tex
Posted 02 September 2009 - 09:00 PM
Insufficient information - show your code... send the text where???
#3
Re: How can I make the key enter close and send what was typed in to a tex
Posted 03 September 2009 - 10:32 AM
Not Sure exactly what you're trying to do, but here's a good starting point:
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Hope that helps!
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Private Sub textbox1_KeyDown(byval sender as Object, byval e as KeyEventArgs) Handles textbox1.KeyDown If e.KeyCode = Keys.Enter Then 'Do something with the textbox1 text. End If End Sub
Hope that helps!
#4
Re: How can I make the key enter close and send what was typed in to a tex
Posted 03 September 2009 - 03:33 PM
Sothrie, on 3 Sep, 2009 - 09:32 AM, said:
Not Sure exactly what you're trying to do, but here's a good starting point:
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Hope that helps!
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Private Sub textbox1_KeyDown(byval sender as Object, byval e as KeyEventArgs) Handles textbox1.KeyDown If e.KeyCode = Keys.Enter Then 'Do something with the textbox1 text. End If End Sub
Hope that helps!
When I press enter it makes a "ding" sound..I would like it if the text box closed. Did I do something wrong or that just the way it is?
#5
Re: How can I make the key enter close and send what was typed in to a tex
Posted 03 September 2009 - 04:27 PM
SexySquirrel, on 3 Sep, 2009 - 02:33 PM, said:
Sothrie, on 3 Sep, 2009 - 09:32 AM, said:
Not Sure exactly what you're trying to do, but here's a good starting point:
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Hope that helps!
To get the value of a textbox after enter is pressed, you will want to handle the textbox_KeyDown event. This event comes with a KeyEventArgs parameter, from which you can tell by the KeyCode whether or not it was the Enter key that was pressed. At that point, you would just have to do whatever it is that you're trying to do with the entered text.
So it'd look something like this:
Private Sub textbox1_KeyDown(byval sender as Object, byval e as KeyEventArgs) Handles textbox1.KeyDown If e.KeyCode = Keys.Enter Then 'Do something with the textbox1 text. End If End Sub
Hope that helps!
When I press enter it makes a "ding" sound..I would like it if the text box closed. Did I do something wrong or that just the way it is?
Never mind I got it. Thank you for your help
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|