How to make a web browser with tabbed browsing with vb 2008?
Posted
by felixd68
on Stack Overflow
See other posts from Stack Overflow
or by felixd68
Published on 2010-03-22T01:43:48Z
Indexed on
2010/03/22
1:51 UTC
Read the original article
Hit count: 410
I've tried multiple times to create a web browser with tabbed browsing. I know that I have to use "tab control".
I have succeeded in creating a semi-tabbed browsing. People are able to add new tabs, but the webbrowser component only appears in one tab page.
Coding:
Form1_Load:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Browse As New WebBrowser
TabControl1.TabPages.Add(1, "TabPage" & i)
TabControl1.SelectTab(1 - 1)
Browse.Name = "wb"
Browse.Dock = DockStyle.Fill
TabControl1.SelectedTab.Controls.Add(Browse)
i = i + 1
End Sub
Web Browser Component
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs)
url.Text = e.Url.ToString()
'your url text box will show the actual url of the page after the page is fully loaded
url.Text = e.Url.ToString
Me.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle & " - Webbrowser's name"
TabControl1.SelectedTab.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle
End Sub
© Stack Overflow or respective owner