vb如何打开本地网页?
发布网友
发布时间:2022-04-29 11:48
我来回答
共1个回答
热心网友
时间:2022-06-27 05:04
Option
Explicit
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
Const
SW_SHOWNORMAL
=
1
Private
Sub
Form_
MouseMove
(Button
As
Integer,
Shift
As
Integer,
X
As
Single,
Y
As
Single)
Label1.FontUnderline
=
False
Label1.ForeColor
=
vbBlack
End
Sub
Private
Sub
Label1_MouseMove(Button
As
Integer,
Shift
As
Integer,
X
As
Single,
Y
As
Single)
Label1.FontUnderline
=
True
Label1.ForeColor
=
vbBlue
End
Sub
Private
Sub
Label1_Click()
ShellExecute
Me.hWnd,
vbNullString,
"你的网址",
vbNullString,
vbNullString,
SW_SHOWNORMAL
End
Sub
ShellExecute
是个
API函数
,可以使用默认程序打开各种格式的文件。