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_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Label1(4).ForeColor = vbBlue End SubPrivate Sub Label1_Click(Index As Integer) On Error resume next 'Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE www://sohu.com, vbMinimizedFocus ShellExecute Me.hwnd, "open", "http://www.sohu.com", vbNullString, vbNullString, 1 Exit Sub End Sub
请在窗体上放置两个标签控件:Label1、Label2 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 Label1_Click() ShellExecute 0&, "Open", "mailto:[email protected]", "", App.Path, 1 End Sub Private Sub Label2_Click() ShellExecute 0&, "Open", "http://www.capricciososoft.com", "", App.Path, 1 End Sub
Label1(4).ForeColor = vbBlue
End SubPrivate Sub Label1_Click(Index As Integer)
On Error resume next
'Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE www://sohu.com, vbMinimizedFocus
ShellExecute Me.hwnd, "open", "http://www.sohu.com", vbNullString, vbNullString, 1
Exit Sub
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 Label1_Click()
ShellExecute 0&, "Open", "mailto:[email protected]", "", App.Path, 1
End Sub
Private Sub Label2_Click()
ShellExecute 0&, "Open", "http://www.capricciososoft.com", "", App.Path, 1
End Sub
同意楼上的。