我在vb.net 2013上制作了一个网页浏览器,每当我右键点击一个链接并按下新窗口它就会把我带到IE新窗口,我希望它在我自己的新窗口中打开,而且我想要有一个新的选项卡选项,右键单击太多提前,这是新的,所以一切都好......这是我的新标签和窗口的代码分别...
Public Sub addTab(ByRef tabControl As TabControl)
Dim browser As New webBrowserFunction
Dim tab As New TabPage
browser.Tag = tab
tab.Tag = browser
TabControl1.TabPages.Add(tab)
tab.Controls.Add(browser)
browser.Dock = DockStyle.Fill
browser.Navigate(My.Settings.HomePage)
TabControl1.SelectedTab = tab
End Sub
Private Sub NewWindowToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NewWindowToolStripMenuItem.Click
Dim newWindow As New frmVortex
newWindow.Show()
End Sub
答案 0 :(得分:0)
Webbrowser控件不支持多个选项卡,但如果要创建新选项卡,则应使用带有多个Web浏览器控件的选项卡控件,请检查:https://social.msdn.microsoft.com/Forums/vstudio/en-US/785637ac-a920-4592-974c-bf9b7ac03b7f/creating-a-multi-tabbed-browser-using-webbrowser-control-in-c?forum=csharpgeneral