Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27071

Tabcontrol / tabpage how to link with webbrowser to open a hyperlink URL

$
0
0
Hello everyone ,

I have a form with textbox, button and a tabcontrol.

in the button I have this code :

[Dim browser As New WebBrowser()
TabPage1.Controls.Add(browser)
browser.Dock = DockStyle.Fill
browser.Navigate(New Uri("http://www.google.com"))]


The code above works, but I need to be able to search from my textbox and when I click the button it will take me to google and then automatically enter's the word I searched for in my textbox and then clicks the search on google button.

I tried this but it does not work. Thanks

Dim textElement. As HtmlElement = browser.Document.All.GetElementsByName("q")(0)
textElement.SetAttribute("value", textbox.text")
Dim btnElement As HtmlElement = browser.Document.All.GetElementsByName("btnG")(0)
btnElement.InvokeMember("click")

Viewing all articles
Browse latest Browse all 27071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>