I will have a web browser in my app and I want it to enter text into a textbox on the page, how would I do this, I am just making an app to restart my router.
I will have a web browser in my app and I want it to enter text into a textbox on the page, how would I do this, I am just making an app to restart my router.
This can be done. you need to try and get the element by ID, the textbox, then once found, set its text on the documentCompleted event.
Example...
private sub webbrowser_documentcompleted(byval sender as object, byval e as WebBrowserDocumentCompletedEventArgs) handled webbrowser.documentcompleted
Dim theElement as HtmlElement = Me.webbrowser.Document.GetElementById("ControlName")
Entering text into site
bshive
This can be done. you need to try and get the element by ID, the textbox, then once found, set its text on the documentCompleted event.
Example...
private sub webbrowser_documentcompleted(byval sender as object, byval e as WebBrowserDocumentCompletedEventArgs) handled webbrowser.documentcompleted
Dim theElement as HtmlElement = Me.webbrowser.Document.GetElementById("ControlName")
if theElement is nothing = false then
'we found the element. set the inner text
theElement.InnerText = "my text"
end if
end sub
does this help
nghianghesi
I've no idea where the text is coming from or really, what it is you're trying to do... Could you be more specific