打开连接: Private Sub Label1_Click() Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE http:\\www.hao123.com", vbNormalFocus End Sub
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 LongPrivate Sub Form_Load() With Me.Label1 .Caption = "Hello World" .ForeColor = vbBlue .FontUnderline = True .AutoSize = True End With End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Me.MousePointer = 0 End SubPrivate Sub Label1_Click() Dim strUrl As String strUrl = "www.csdn.net" ShellExecute hwnd, "Open", strUrl, "", "", 1 End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Me.MousePointer = 9 End Sub我这里只是把鼠标变成箭头,如果你要变成手,你就要找一张手形的ico代替
Private Sub Label1_Click()
Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE http:\\www.hao123.com", vbNormalFocus
End Sub
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 LongPrivate Sub Form_Load()
With Me.Label1
.Caption = "Hello World"
.ForeColor = vbBlue
.FontUnderline = True
.AutoSize = True
End With
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 0
End SubPrivate Sub Label1_Click()
Dim strUrl As String strUrl = "www.csdn.net"
ShellExecute hwnd, "Open", strUrl, "", "", 1
End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.MousePointer = 9
End Sub我这里只是把鼠标变成箭头,如果你要变成手,你就要找一张手形的ico代替
第二种,找不到shell32.dll
不过还是谢谢两位了