944,191 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 10222
  • VB.NET RSS
Nov 28th, 2006
0

Web Browser control with Tabcontrol

Expand Post »
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
Quote ...
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)



VB.NET Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ChadW is offline Offline
42 posts
since Oct 2006
Nov 28th, 2006
0

Re: Web Browser control with Tabcontrol

>> 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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,963 posts
since Aug 2005
Nov 29th, 2006
0

Re: Web Browser control with Tabcontrol

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?
Reputation Points: 10
Solved Threads: 0
Light Poster
ChadW is offline Offline
42 posts
since Oct 2006
Feb 17th, 2008
0

Re: Web Browser control with Tabcontrol

Imagning the tab control is tc

VB.NET Syntax (Toggle Plain Text)
  1. tc.selectedtab

will do it
Reputation Points: 10
Solved Threads: 0
Newbie Poster
r.anshul is offline Offline
12 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: I dont want objreader to read spaces
Next Thread in VB.NET Forum Timeline: vb.net2003 paralle port





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC