aflorence07
asked on
How do I redirect or avoid WebBrowser Control from Stealing Focus
I am trying to write a program that uses a WebBrowser control to automatically login to a particular website to upload data to the website. Basically, the UI of the website is poor and permits many input mistakes to happen, so I need to write a program which acts as a frontend to the hidden website. There is a usernameTextBox, userpasswordTextBox, and loginButton. I have the autologin functional, but when the main webpage loads, my usernameTextBox loses focus and becomes frustrating to input username and password.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Closed, 500 points refunded.
Computer101
EE Admin
Computer101
EE Admin
This is what the HTML tag looks like for the www.google.com search field:
<input maxLength=256 size=55 name=q value="">
Let's say I've got a combo box named cboData
The following code will look for an INPUT tag with name = "q". When it finds it, the current value of the combo box will be put into the search field.
Set docCurrentHTML = MyBrowser.Document.documen
For Each Item In docCurrentHTML
If Item.tagName = "INPUT" Then
If Item.Name = "q" Then
Item.Value = cboData.Text
Exit For
End If
End If
Next Item
is this what you're referring to?
http://www.vbforums.com/archive/index.php/t-160521.html