I've created a web browser (similar to the beginners project) with the following items:

  • 1 Text Box (for url entry, with "enter" support)
  • 4 Nav buttons (Forward, Back, Go, Home)
  • 1 Tabcontrol holding 2 tabbed pages

Question: How do I get TabPage2 to navigate to the entered URL? Currently, only TabPage1 responds when a URL is entered into the textbox. I've tried IF/THEN statements, but it's not working. (Though, to be fair, I'm still a newb. hehe) Currently, you'll see that I have a statement

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
End Sub

And yes, I understand that it is doing exactly what it's supposed to, I just can't figure out how to tell program that when the tabpage2 is active, to navigate that page (and not tabpage1)

Public Class Form1
 
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(TextBox1.Text)
End Sub
 
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
WebBrowser1.GoBack()
End Sub
 
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
WebBrowser1.GoForward()
End Sub
 
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
WebBrowser1.Navigate("http://google.com")
End Sub
 
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
WebBrowser1.Navigate(TextBox1.Text)
End If
End Sub
 
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
TextBox1.Text = WebBrowser1.Url.ToString
End Sub
 
End Class

>> Typo's are one thing. Completely failing to grasp the concept of proper spelling and grammar, is just plain dumb.

English is not the native language of many posters, so I rarly, if ever, criticize anyone for their use of English unless they use abbreviations such as y for you.

Sorry about not answering your question -- I don't know. :confused:

My signature was aimed more towards those folks that use "Lazy Speak" or "L33T speak", words like: u or ur, hai, etc. However, I do see how the way my sig is phrased could be construed differently.

That aside.. anyone have any ideas pertaining to my question?

Imagning the tab control is tc

tc.selectedtab

will do it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.