VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 307,177 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,573 people online right now. Registration is fast and FREE... Join Now!




How can I make the key enter close and send what was typed in to a tex

 

How can I make the key enter close and send what was typed in to a tex, How to send a value when pressing enter.

SexySquirrel

2 Sep, 2009 - 07:17 PM
Post #1

D.I.C Head
**

Joined: 30 Aug, 2009
Posts: 54


My Contributions
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?

User is offlineProfile CardPM
+Quote Post

 
Reply to this topicStart new topic
Replies(1 - 4)

mark.bottomley

RE: How Can I Make The Key Enter Close And Send What Was Typed In To A Tex

2 Sep, 2009 - 08:00 PM
Post #2

D.I.C Addict
****

Joined: 22 Apr, 2009
Posts: 868



Thanked: 148 times
My Contributions
Insufficient information - show your code... send the text where???
User is offlineProfile CardPM
+Quote Post

Sothrie

RE: How Can I Make The Key Enter Close And Send What Was Typed In To A Tex

3 Sep, 2009 - 09:32 AM
Post #3

New D.I.C Head
*

Joined: 3 Dec, 2007
Posts: 37



Thanked: 4 times
My Contributions
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:
CODE

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!
User is offlineProfile CardPM
+Quote Post

SexySquirrel

RE: How Can I Make The Key Enter Close And Send What Was Typed In To A Tex

3 Sep, 2009 - 02:33 PM
Post #4

D.I.C Head
**

Joined: 30 Aug, 2009
Posts: 54


My Contributions
QUOTE(Sothrie @ 3 Sep, 2009 - 09: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:
CODE

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?
User is offlineProfile CardPM
+Quote Post

SexySquirrel

RE: How Can I Make The Key Enter Close And Send What Was Typed In To A Tex

3 Sep, 2009 - 03:27 PM
Post #5

D.I.C Head
**

Joined: 30 Aug, 2009
Posts: 54


My Contributions
QUOTE(SexySquirrel @ 3 Sep, 2009 - 02:33 PM) *

QUOTE(Sothrie @ 3 Sep, 2009 - 09: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:
CODE

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 smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 07:35PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month