webbrowser控件做的浏览器,怎样解决ie打开新窗口问题
用vb的webbrowser做的浏览器控件,可是在打开弹出新窗口的连接时,都是弹出ie的浏览器打开的窗口
我该怎么办??????   
情此道高手帮帮我吧!!   
十分感谢!
2007-3-1 11:58 回复 
女孩沐蓝苛
10位粉丝
2楼
吃完饭后来帮你解决!
2007-3-1 12:10 回复 
女孩沐蓝苛
10位粉丝
3楼
同程序中打开新窗口显示新网页 
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) 
Dim frmWB As Form1 
Set frmWB = New Form1 
frmWB.WebBrowser1.RegisterAsBrowser = True 
Set ppDisp = frmWB.WebBrowser1.Object 
frmWB.Visible = True 
End Sub
2007-3-1 12:43 回复 
59.58.63.* 4楼
hao ji le
2007-6-16 09:06 回复 
liupandeng1984
0位粉丝
5楼
太强了
2007-11-23 00:28 回复 
211.142.247.* 6楼
还是打开的新窗口,要能在本身的窗口打开就好了......
2007-11-23 12:38 回复 
女孩沐蓝苛
10位粉丝
7楼
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) 
Set ppDisp = WebBrowser1.Application
End Sub
2008-5-19 22:09 回复 
218.26.224.* 8楼
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) 
Set ppDisp = WebBrowser1.Application 
End Sub 
不可以啊,没有反应啊
2008-7-14 16:02 回复 
_开始腐烂
0位粉丝
9楼
晕死,我之前恢复的帖子怎么删除了?
等下。给两个效果你。
如果要源码,你留下邮箱。
2008-7-15 09:55 回复 
_开始腐烂
0位粉丝
10楼
像图片中那样添加Text1,Command1,Option1,Option2,Webbrowser1,Webbrowser2
代码开始:
Private Sub Command1_Click()
WebBrowser1.Navigate Text1.Text
End Sub
Private Sub Form_Resize()
If Me.WindowState <> 1 Then WebBrowser1.Width = Me.ScaleWidth: WebBrowser1.Height = Me.ScaleHeight - WebBrowser1.Top
End Sub
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
If Option1.Value = True Then
Set ppDisp = WebBrowser2.Application
WebBrowser2.ZOrder
Else
Dim NewForm As New Form1
NewForm.Show
Set ppDisp = NewForm.WebBrowser1.Application
NewForm.WebBrowser1.ZOrder
End If
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)
WebBrowser2.Stop
WebBrowser1.Stop
WebBrowser1.Navigate URL
End Sub
web浏览器在哪里打开
2008-7-15 10:11 回复 
_开始腐烂
0位粉丝
11楼
注释版:
Private Sub Command1_Click() 
WebBrowser1.Navigate Text1.Text '点击Command1打开Text1的网址
End Sub 
Private Sub Form_Resize() 
If Me.WindowState <> 1 Then WebBrowser1.Width = Me.ScaleWidth: WebBrowser1.Height = Me.ScaleHeight - WebBrowser1.Top '让Webbrowser1适应
窗口大小
End Sub 
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) 
If Option1.Value = True Then '如果单选框Option1(在当前窗口打开)
Set ppDisp = WebBrowser2.Application
WebBrowser2.ZOrder 
'在Webbrowser2中打开,请跳到WebBrowser2_BeforeNavigate2看
Else '如果选择了在新窗口中打开
Dim NewForm As New Form1
NewForm.Show '弹出一个新的Form1窗口
Set ppDisp = NewForm.WebBrowser1.Application 
NewForm.WebBrowser1.ZOrder 
'在新弹出的Form1窗口打开
End If 
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) 
WebBrowser2.Stop 'Webbrowser2停止
WebBrowser1.Stop 'Webbrowser1停止
WebBrowser1.Navigate URL 'Webbrowser1打开网址
End Sub
2008-7-15 11:00 回复 
dvchen
0位粉丝
12楼
请教两个webbrowser,在对象窗口webbrowser1,webbrowser2依次叠加在一起吗?分别怎么设置?
2008-8-13 11:34 回复 
219.138.40.* 13楼
大家试一试下面的 准可以 哈哈
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Cancel = True
WebBrowser1.Navigate2 WebBrowser1.Document.activeElement.href
End Sub
2009-4-24 13:17 回复 
123.172.126.* 14楼
Dim WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1
Private Sub Form_Load()
Set Web_V1 = WebBrowser1.Object
WebBrowser1.Navigate2 "www.sina"
End Sub
Private Sub Web_V1_NewWindow(ByVal URL As String, _
ByVal Flags As Long, _
ByVal TargetFrameName As String, _
PostData As Variant, _
ByVal Headers As String, _
Processed As Boolean)
Processed = True
WebBrowser1.Navigate URL
End Sub
2009-12-10 06:01 回复 
123.172.49.* 15楼
13楼的好用,谢谢
2010-1-20 07:49 回复 
112.115.37.* 16楼
11楼的好用
2010-2-5 22:06 回复 
共有16篇贴子 发表回复
内 容:
用户名: 您目前是匿名发表 登录 | 注册 
验证码:  请点击后输入验证码,加入会员后本吧发贴免验证码。 
?2010 Baidu 贴吧协议  意见反馈

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。