SendKeys Help

Posts 1–7 of 7 · Page 1 of 1
SendKeys Help
Hello Fellow Coders,

I have a very simple question. This is extremely simple, and I haven't been able to figure it out. It makes me feel like an idiot. How do I make a button send using the enter key, or for a web browser, make the textbox send using enter instead of only the button? Help would be greatly appreciated.

Thanks,

PJ
in timer1 add this code.

as for the webbrowser im not sure!!

[php]
sendkeys.send(textbox1.text)
sendkeys.send("{Enter}")
[/php]

if the above code dont work. post you full code here.. in php script style by going

[ php ] code here [/ ph p ]

Without space's
On the button's click event add the following code:

Sendkeys.Send(Textbox1.Text)
Sendkeys.Send("{Enter}")

This will send the keys to the active application.

Note: To activate an application, use the following function before the two lines shown above:

AppActivate ("Application Title")
'Replace "Application Title" with the title of the application you're spamming in. For example: You can use "Mozilla FireFox", if you want to spam in the Webbrowser.

So the final code will be:

AppActivate ("Application Title")
Sendkeys.Send(Textbox1.Text)
Sendkeys.Send("{Enter}")

To auto-send add the same code in a timer.

Hope this helps.
Well i was close haha. thanks FLAME
Quote Originally Posted by TIS2 View Post
Well i was close haha. thanks FLAME
Ya, you were, but Focus is an important part of any spammer. So, it must be used. AppActivate uses normal focus technique. Focus via API will be best.
Webbrowser Textbox - Hit enter to navigate ->

Code:
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            WebBrowser1.navigate("url")
        End If
    End Sub
Quote Originally Posted by Blubb1337 View Post
Webbrowser Textbox - Hit enter to navigate ->

Code:
Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyCode = Keys.Enter Then
            WebBrowser1.navigate("url")
        End If
    End Sub
I got an error at
Code:
e.KeyCode
It says that KeyCode is not a member of System.EventArgs



NEVER MIND. I figured it out. Thanks alot.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?