VB创建网页浏览

Private WithEvents Ie As VBControlExtender

'动态删除控件
Private Sub Command2_Click()
Controls.Remove “Ie”
End Sub

Private Sub Command1_Click()
Dim strweb As String
Text1 = WebDaima(Ie, “All”)
End Sub

Private Sub Command3_Click()
'Ie.object.document.parentwindow.scrollby 0, 1 '页面向下滚动1像素
'Ie.object.Refresh’刷新当前页面
'Ie.object.Stop’停止当前页面及其内容的载入
'Ie.object.GoHome’连接用户默认的主页
Ie.object.GoBack '使你在当前历史列表中后退一项
End Sub

Private Sub Command4_Click()
Ie.object.GoForward '使你在当前历史列表中前进一项
End Sub

Private Sub Command5_Click()
'Ie.object.document.oncontextmenu = False
End Sub

Private Sub Form_Load()
Dim URL As String
URL = “www.baidu.com”
Set Ie = Me.Controls.Add(“Shell.Explorer.2”, “IE”, Me) '相当于在程序内创建Webbrowser控件
Ie.object.Navigate URL
Ie.Visible = 1
Ie.object.Silent &

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 1024 设计师:白松林 返回首页