vb 打开网页时始终在WebBrowser1显示
在打开在WebBrowser1中的网页时,最好是显示在WebBrowser1中,而不是打开一个新的ie显示该页...
在打开在WebBrowser1中的网页时,最好是显示在WebBrowser1中,而不是打开一个新的ie显示该页
展开
展开全部
如何让新窗口链接在本窗口直接打开
1.建2个WebBrowser分别为WebBrowser1、WebBrowser2
2.添加代码如下:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Set ppDisp = WebBrowser2.Object
End Sub
Private Sub WebBrowser2_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
Cancel = True
WebBrowser1.Navigate URL
End Sub
1.建2个WebBrowser分别为WebBrowser1、WebBrowser2
2.添加代码如下:
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Set ppDisp = WebBrowser2.Object
End Sub
Private Sub WebBrowser2_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
Cancel = True
WebBrowser1.Navigate URL
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询