情趣用品蝴蝶:怎么在vb窗体上调用ie浏览

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/07 02:32:28

给你个API函数和自定义的超链接的函数

API函数声明:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

自定义函数
'############################
'# 网络链接 #
'#--------------------------#
'# 调用API: #
'# GetDesktopWindow #
'# ShellExecute #
'############################
Public Function StartURL(URL As String) As Long '网络链接
Dim Scr_hDC As Long
Scr_hDC = GetDesktopWindow()
StartURL = ShellExecute(Scr_hDC, "Open", URL, vbNullString, "C:\", 1)
End Function

使用控件....==
Microsoft Internet Controls
然后拉一个空间出来
WebBrowser1.Navigate 网址
就可以了

使用shell函数call Shell( "explorer.exe http://www.baidu.com", vbNormalFocus)
注意http前面有一个空格。

Shell "explorer.exe http://zhidao.baidu.com/"

这个简单,直接放到Click事件中就可以了