4 Replies - 1565 Views - Last Post: 03 September 2009 - 04:27 PM Rate Topic: -----

#1 SexySquirrel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 97
  • Joined: 30-August 09

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

Posted 02 September 2009 - 08:17 PM

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?
Is This A Good Question/Topic? 0
  • +

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

#2 mark.bottomley  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 990
  • Joined: 22-April 09

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???
Was This Post Helpful? 0
  • +
  • -

#3 Sothrie  Icon User is offline

  • New D.I.C Head

Reputation: 8
  • View blog
  • Posts: 41
  • Joined: 03-December 07

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:
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!
Was This Post Helpful? 0
  • +
  • -

#4 SexySquirrel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 97
  • Joined: 30-August 09

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

View PostSothrie, 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:
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?
Was This Post Helpful? 0
  • +
  • -

#5 SexySquirrel  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 97
  • Joined: 30-August 09

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

View PostSexySquirrel, on 3 Sep, 2009 - 02:33 PM, said:

View PostSothrie, 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:
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 :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1