鼠标点击事件,点击 Label 链接 www.163.com 。代码如下:
Private Sub Label1_Click()
Shell "c:\Program Files\Internet Explorer\IEXPLORE.EXE www.163.com", 1
End Sub要求:当系统装在D:盘下的时候,点击Label还能打开网页,或者说当系统安装在随便什么盘上都还,依然可以打开网页。不知道如下代码是否可行:Private Sub Command2_Click()
On Error Resume Next
Dim o As Object
Set o = CreateObject("wscript.shell")
o.run ("IEXPLORE.EXE www.163.com")
Set o = Nothing
End Sub
Private Sub Label1_Click()
Shell "c:\Program Files\Internet Explorer\IEXPLORE.EXE www.163.com", 1
End Sub要求:当系统装在D:盘下的时候,点击Label还能打开网页,或者说当系统安装在随便什么盘上都还,依然可以打开网页。不知道如下代码是否可行:Private Sub Command2_Click()
On Error Resume Next
Dim o As Object
Set o = CreateObject("wscript.shell")
o.run ("IEXPLORE.EXE www.163.com")
Set o = Nothing
End Sub
Private Sub Label1_Click()
On Error Resume Next
Dim o As Object
Set o = CreateObject("wscript.shell")
o.run ("IEXPLORE.EXE www.163.com")
Set o = Nothing
End Sub
当系统安装在D盘的时候,点击Label还能打开网页不?
Label1.ForeColor = vbBlue
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label1.ForeColor <> vbBlue Then
Label1.ForeColor = vbBlue
End If
End SubPrivate Sub Label1_Click()
ShellExecute 0, "open", "http://www.163.com", "", App.Path, 5
End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Label1.ForeColor <> vbRed Then
Label1.ForeColor = vbRed
End If
End Sub