webbrowser制作多标签浏览器问题
想做一个浏览器,但是找遍了全网都没有教程,跪求大佬帮我写个我学习下,感谢了!
浏览器如图 有前进,后退,刷新,首页(点击后跳转到网址A),官网(点击后跳转到网址B)
下面的webbrowser框初始网站随便填一个,如果浏览的网页链接是在新页面打开,那么则自动在浏览器上面添加一个网页(类似360和chrome的多标签一样)双击或者点击每个页面的关闭按钮可关闭当前网页,谢谢啦,跪求源码
'以下代码都是在 MDIForm中的 Private Sub Command2_Click() On Error Resume Next If Me.ActiveForm.Name = "Form1" Then Me.ActiveForm.WebBrowser1.GoBack ' End If End Sub Private Sub Command4_Click() On Error Resume Next If Me.ActiveForm.Name = "Form1" Then Me.ActiveForm.WebBrowser1.GoForward ' End If End Sub Private Sub Command5_Click() On Error Resume Next If Me.ActiveForm.Name = "Form1" Then Me.ActiveForm.WebBrowser1.Refresh ' End If End Sub Private Sub Command1_Click() '新建 Dim fr As New Form1 fr.WebBrowser1.Navigate HomeUrl '自动打开首页 fr.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight '窗口自动最大,不是最大化 End Sub
Private Sub Command1_Click() WebBrowser1.Navigate2 Text1.Text End Sub
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) On Error Resume Next Dim fr As New Form1 fr.Show Set ppDisp = fr.WebBrowser1.Object fr.Move 0, 0, MDIForm1.ScaleWidth, MDIForm1.ScaleHeight End Sub
Private Sub WebBrowser1_OnQuit() '浏览器退出 Unload Me End Sub Private Sub WebBrowser1_StatusTextChange(ByVal Text As String) '提示 If Len(Text) > 0 Then Label1.Caption = Text Else Label1.Caption = "完成" End If End Sub Private Sub WebBrowser1_WindowClosing(ByVal IsChildWindow As Boolean, Cancel As Boolean) '浏览器要求关闭 Unload Me End Sub
Private Sub WebBrowser1_DownloadBegin() WebBrowser1.Silent = True End Sub Private Sub WebBrowser1_DownloadComplete() WebBrowser1.Silent = True End Sub