Private sub Form1_load()
Label1.FontUnderline = True
Label1.caption = "http://www.163.com"
Label1.ForeColor = vbBlue
End Sub
Private Sub Label1_Click()
Shell "explorer.exe http://www.163.com"
End Sub
Private 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
Public Const URL = "http://www.dlsz.com"
Dim Success As Long
Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
API:ShellExecute函数