I made a web browser with vb.Net's webBrowser from the toolbox. When i clicked a button that should works as a navigator (for example, when i clicked button A, the web browser should navigate into a.html, but when i clicked b, the browser should navigate to b.html). The thing is, it doesn't work. Whenever i clicked 1 button, and tried to click other button, the web browser wouldn't navigate.
Here's the code :
Private Sub aToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles aToolStripMenuItem.Click
browser.Visible = True
browser.Navigate(New Uri("a.html"))
End Sub
Private Sub bToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles bToolStripMenuItem.Click
If browser.Visible = True Then
browser.Navigate(New Uri("\b.html"))
ElseIf browser.Visible = False Then
browser.Visible = True
browser.Navigate(New Uri("\b.html"))
End If
End Sub
Please correct me if i have any problems in the code. Fyi, i use a menu strip in the project, so the menu strip's choice should work like a button.