Hello, I am building a webbrowser using VB.Net 2010, and I am having trouble updating the url when I switch between open tabs using tabcontrol. I am also using a textbox for the address bar. Any help would be appreciated Thanks!
thing2
0
Newbie Poster
Recommended Answers
Jump to PostUse the .Tag Property of the selectedTab when navigating to a site, to store the URL in. When switching between tabs, retrieve the .Tag of the selectedTab and display it in your TextBox. Hope this helps.
Jump to PostIf you are trying to save the navigated URL of the webbrowser before switching tabs, you could try something like this:
Add this on the TabControl1_Selected Event
Private Sub TabControl1_Selected(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TabControlEventArgs) Handles TabControl1.Selected If TabControl1.SelectedTab.Text = "TabPage2" Then txtURL.Text = …
Jump to Postthing2, what exactly are you wanting to accomplish? If you are just trying to save the WebBrowser's URL when you switch tabs then have it display in the URL box then my code should work just fine.
Jump to PostTry this in a new project with a TabControl containing 2 TabPages.
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load With TabControl1 .TabPages(0).Tag = "hi" .TabPages(1).Tag = "hello" End With End Sub Private Sub TabControl1_SelectedIndexChanged(ByVal sender As Object, ByVal e …
All 15 Replies
codeorder
197
Nearly a Posting Virtuoso
NetJunkie
29
Junior Poster
thing2
0
Newbie Poster
NetJunkie
29
Junior Poster
thing2
0
Newbie Poster
codeorder
197
Nearly a Posting Virtuoso
thing2
0
Newbie Poster
codeorder
197
Nearly a Posting Virtuoso
thing2
0
Newbie Poster
codeorder
197
Nearly a Posting Virtuoso
thing2
0
Newbie Poster
codeorder
197
Nearly a Posting Virtuoso
thing2
0
Newbie Poster
NetJunkie
29
Junior Poster
NetJunkie
29
Junior Poster
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.