Web Browser control with Tabcontrol

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 42
Reputation: ChadW is an unknown quantity at this point 
Solved Threads: 0
ChadW's Avatar
ChadW ChadW is offline Offline
Light Poster

Web Browser control with Tabcontrol

 
0
  #1
Nov 28th, 2006
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)



  1.  
  2. Public Class Form1
  3.  
  4. Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5. WebBrowser1.Navigate(TextBox1.Text)
  6. End Sub
  7.  
  8. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  9. WebBrowser1.GoBack()
  10. End Sub
  11.  
  12. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  13. WebBrowser1.GoForward()
  14. End Sub
  15.  
  16. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  17. WebBrowser1.Navigate("http://google.com")
  18. End Sub
  19.  
  20. Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
  21. If e.KeyCode = Keys.Enter Then
  22. WebBrowser1.Navigate(TextBox1.Text)
  23. End If
  24. End Sub
  25.  
  26. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
  27. TextBox1.Text = WebBrowser1.Url.ToString
  28. End Sub
  29.  
  30. End Class
Last edited by ChadW; Nov 28th, 2006 at 1:42 pm.
Insert generic signature here
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,331
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1453
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Web Browser control with Tabcontrol

 
0
  #2
Nov 28th, 2006
>> 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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 42
Reputation: ChadW is an unknown quantity at this point 
Solved Threads: 0
ChadW's Avatar
ChadW ChadW is offline Offline
Light Poster

Re: Web Browser control with Tabcontrol

 
0
  #3
Nov 29th, 2006
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?
Insert generic signature here
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 12
Reputation: r.anshul is an unknown quantity at this point 
Solved Threads: 0
r.anshul r.anshul is offline Offline
Newbie Poster

Re: Web Browser control with Tabcontrol

 
0
  #4
Feb 17th, 2008
Imagning the tab control is tc

  1. tc.selectedtab

will do it
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC