I have written a piece of a code which takes the postcode from my textbox then searches it within Bing for the user, at the moment all of it is on Form1 and works as it should, I'm looking to improve on the idea by allowing the user to press a button on Form1 then the web browser appearing in Form2. So far my attempts to figure this out have failed and was wondering if anyone had any ideas.
I have attached a copy of my code which all works within in one Form
Public Class Form1
Dim Automate As Boolean
Private Sub BTNMap_Click_1(sender As Object, e As EventArgs) Handles BTNMap.Click
Automate = True
WebBrowser1.Navigate("http://www.bing.com")
End Sub
Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As
WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
If Automate = True Then Automate = False Else Exit Sub
Dim txt As HtmlElement = WebBrowser1.Document.GetElementById("q")
Dim btn As HtmlElement = WebBrowser1.Document.GetElementById("go")
txt.SetAttribute("value", PostcodeTextBox.Text)
btn.InvokeMember("click")
End Sub
End Class