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 Label1_Click() ShellExecute Me.hwnd, vbNullString, "http://www.sina.com.cn", vbNullString, "C:\", SW_SHOWNORMAL End Sub
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 Longlabel的CLICK事件:ShellExecute Me.hwnd, "open", "http://www.csdn.net", 0, 0, 0 顺便说一句,在 VB.Net 里到是有现成的一个控件
把Label的font设置一下就行了。
shell 就可以了!!
直接调用IE
Const SW_SHOWNORMAL = 1
Private Sub Label1_Click() ShellExecute Me.hwnd, vbNullString, "http://www.sina.com.cn", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
如:WebBrowser1.Navigate2 "www.sina.com.cn"
顺便说一句,在 VB.Net 里到是有现成的一个控件