Private Sub Label1_Click() brwWeb1.Navigate "http://www.sina.com.cn" End Sub
Public Const URL = "http://www.dlsz.com" Dim Success As Long Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL) API:ShellExecute函数
Option ExplicitPrivate Sub Form_Load() Me.Label1.Caption = "HTTP://WWW.21CN.COM" Me.Label1.Font.Underline = True Me.Label1.ForeColor = RGB(0, 0, 255) End SubPrivate Sub Label1_Click() RunFile Label1.Caption End SubPublic Function RunFile(FilePath As String) Call Shell("rundll32.exe url.dll,FileProtocolHandler " & FilePath, 1) End Function
Private sub Form1_load() Label1.FontUnderline = True Label1.caption = "http://www.163.com" Label1.ForeColor = vbBlue End SubPrivate Sub Label1_Click() Shell "explorer.exe http://www.163.com" End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If (X > 50 And Label1.Width - X > 50) And (Y > 50 And Label1.Height - Y > 50) Then Label1.ForeColor = vbGreen Else Label1.ForeColor = vbBlue End If End Sub
brwWeb1.Navigate "http://www.sina.com.cn"
End Sub
Dim Success As Long
Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
API:ShellExecute函数
Me.Label1.Caption = "HTTP://WWW.21CN.COM"
Me.Label1.Font.Underline = True
Me.Label1.ForeColor = RGB(0, 0, 255)
End SubPrivate Sub Label1_Click()
RunFile Label1.Caption
End SubPublic Function RunFile(FilePath As String)
Call Shell("rundll32.exe url.dll,FileProtocolHandler " & FilePath, 1)
End Function
uc.url="http://www.csdn.net"这样是不是更好一些
:)
Label1.FontUnderline = True
Label1.caption = "http://www.163.com"
Label1.ForeColor = vbBlue
End SubPrivate Sub Label1_Click()
Shell "explorer.exe http://www.163.com"
End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (X > 50 And Label1.Width - X > 50) And (Y > 50 And Label1.Height - Y > 50) Then
Label1.ForeColor = vbGreen
Else
Label1.ForeColor = vbBlue
End If
End Sub