4 Replies - 18596 Views - Last Post: 12 June 2009 - 11:43 AM Rate Topic: -----

#1 Robban98422  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 09

Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

Posted 12 June 2009 - 08:11 AM

Hello i am new at this forum and i have just begin to learn Visual Basic, and i have come a bit on they way but i am stuck with a problem.
Thats why i did find this forum i hope :)

okej here is the code
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
		SendKeys.Send(TextBox1.Text)
		SendKeys.Send("( )")
		SendKeys.Send(TextBox2.Text)
		SendKeys.Send("( )")
		SendKeys.Send(Keys.Enter)
	End Sub
End Class



As you may see it is a "flooder", and i am just playing around with the program, evrything worked, until i did want to try it on msn, and i have to use the "enter" or "return" button. to send the text.

insted of "pressing" the enter button and send it, it just writes the number 43? it is this line that i have problems with "SendKeys.Send(Keys.Enter)"

anyone wanna help :)?

Is This A Good Question/Topic? 0
  • +

Replies To: Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

Posted 12 June 2009 - 08:28 AM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#3 Zooms  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 78
  • Joined: 04-December 08

Re: Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

Posted 12 June 2009 - 08:51 AM

If you want it to send the Enter key, i think the correct code is:


Sendkeys.Send("{ENTER}")

Was This Post Helpful? 0
  • +
  • -

#4 Cookiesliyr  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 136
  • Joined: 16-May 09

Re: Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

Posted 12 June 2009 - 10:37 AM

will send key will send keys to the focus item , but it deals with strings ... to send enter u need to send it as ascii value, i do that usualy in VB6 but in net u can do that by using ASCII or Unicode , the later has two values to represent Enter, any way ... to send the key enter to the textbox u need to set it on focus first then send the Enter value (which is 13 in ascii ) by using chr function

Textbox1.focus()
Sendkeys.Send (chr(13))



will that to send enter. to know more about ASCII visit ASCII

This post has been edited by Cookiesliyr: 12 June 2009 - 10:38 AM

Was This Post Helpful? 0
  • +
  • -

#5 Robban98422  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 09

Re: Newbie need help, SendKeys.Send(Keys.enter) getting numbers ?

Posted 12 June 2009 - 11:43 AM

ah okej okej, i will try ASCII later, but Zooms version did work to. :) thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1