首先在窗体上放一个 label(label1),将其Caption设为"http://www.sina.com.cn",然后,在代码窗口输入以下代码:Public 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 Label1_Click()
OpenURL Me, Label1.Caption
End SubPrivate Sub OpenURL(objForm As Form, strURL As String)
Call ShellExecute _
(objForm.hwnd, "open", strURL, vbNullString, vbNullString, &H0)End Sub
运行,点击 label1,是不是在IE打开链接了?至于其他,比如变色之类的辅助功能,你可以自己加喽
(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 Label1_Click()
OpenURL Me, Label1.Caption
End SubPrivate Sub OpenURL(objForm As Form, strURL As String)
Call ShellExecute _
(objForm.hwnd, "open", strURL, vbNullString, vbNullString, &H0)End Sub
运行,点击 label1,是不是在IE打开链接了?至于其他,比如变色之类的辅助功能,你可以自己加喽
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货