Problem with sendkeys, Does not send proper String

Gluttard

Active member
Joined
Jan 9, 2008
Messages
44
Programming Experience
Beginner
If you put a timer into a form, then in the Timer handler you send keys, it does not work properly. It works in Word or Notepad but not on web based text editors.

For example, open a new project, put a timer in, enable it, put it at an interval of 1000, and then put this code in:
PHP:
Public Class Form1
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        SendKeys.Send("Why doesn't this work?")
    End Sub
End Class

The first couple times, it'll write it all fine, you can even try it out in the reply box on this site, and then BOOM, it goes crazy!
I've tried a whole bunch of things, nothing seems to solve this. Anyone have any ideas?
 
I haven't had a problem it that, the receiving window has be active of course, but they way you put it, sending a few work then "crazy" I can't replicate.
 
Could it only be my computer?
Here's the result I get from the above code, this thing i'm typing in is 'Focused':
Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?Why doesn't this work?WWWWhhhhyyyyyyyyyyyyyyyyyyyyyyyy ddddddddddddddddddooooooooeeeeeeeesssssssssssnnnnn''''''''''''''''''tttttttttttttttttttttttttttttttt tttthiiiiiiiiiiisssssssssssssssss wwwwwwwwwwwworkkkkkkkkkkkkk??WWWWWWWWWWWWWhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhy ddddooooooeeessssssn''t thhhhhhhhhhhhhiiiiiiis wwwwwwwwwwwwwwwoooooooooorrrrrrrrrrrrrrrrrrrrkkkkk??

Give it some time, see if it freaks out.
 
Last edited by a moderator:
No, it doesn't :)
 
Hmm. It must be my computer then.
I'll check it next time I have easy access to another computer.
Thanks anyways.
 
Back
Top