vb6怎样button弹网页

来源:百度知道 编辑:UC知道 时间:2024/06/14 12:43:40
你点一下button就会弹出自己要设置的网页
我忘记了
麻烦高手说一下

首先声明下函数:
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
然后在按钮单击事件里写:
ShellExecute 0, vbNullString, "http://www.baidu.com", vbNullString, vbNullString, vbNormalFocus '这里写你需要设置的网址
完整代码如下:
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

Private Sub Command1_Click()
ShellExecute 0, vbNullString, "http://www.baidu.com", vbNullString, vbNullString, vbNorm