In
VB.NET I have a form with a textbox, button and a web browser object.
I have coded the button to open a website, within the web browser object.
Now what I want to do is copy the text typed in the textbox on my form and paste it on a textbox on this website.
The problem would be simple if the cursor is already placed in the textbox however it isn't. Otherwise I would just use sendkeys and paste. However the textbox on the website is not set to focus, so how can I overcome this problem.
I also can't edit the website =]
5 stars for the best answer (also if I need to activate something please tell me)
The code I have already is (within the button):
webbrowser.Navigate("[website]")
Clipboard.Clear()
Clipboard.SetText(textbox1.Text)
webbrowser.focus
Clipboard.GetText()
Threading.Thread.Sleep(5000)
SendKeys.SendWait("{enter}")
What do I need to change in order for the clipboard to paste the text thats stored on it, into a textbox on a website that has loaded up in the web browser object.
No the tab order won't work.
.focus and the tab order work only on forms and not within the objects. So for example it will focus on a textbox within a form, but not on a textbox within a web browser object displayed on a website. And thats what I need to accomplish.
Thanks for trying to help anyway =]
Any suggestions?
Ghost you are on the right lines.
You know exactly what I want you to do. However I don't want it automatically going on to (for example) the search feature. Since that is a very good idea, and would make it easier however I want the website to load up and insert the text into the textbox on the website. (There is a special reason for this)
Do you know how I could do this?
Nope that didn't work.
Ghost was on the right lines.
I just need to focus on a textbox that is on a website.
Help please
we are nearly there
any ideas?