Option Explicit Dim MouseNotExit As BooleanPrivate Sub Label1_Click() Dim pID As Long If MouseNotExit Then 'pID = Shell("Notepad", vbNormalFocus) ' Shell ?回 Process Id pID = Shell("explorer.exe Http://www.yahoo.co.jp", vbNormalFocus) ' Shell ?回 Process Id End If
End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) MouseNotExit = (400 <= X) And (X <= Label1.Width - 400) And (50 <= Y) And (Y <= Label1.Height - 50)If MouseNotExit Then Me.Label1.ForeColor = &HFF0000 'SetCapture Picture1.hWnd Else 'ReleaseCapture Me.Label1.ForeColor = &H0End IfEnd Sub
Dim MouseNotExit As BooleanPrivate Sub Label1_Click()
Dim pID As Long
If MouseNotExit Then
'pID = Shell("Notepad", vbNormalFocus) ' Shell ?回 Process Id
pID = Shell("explorer.exe Http://www.yahoo.co.jp", vbNormalFocus) ' Shell ?回 Process Id
End If
End SubPrivate Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MouseNotExit = (400 <= X) And (X <= Label1.Width - 400) And (50 <= Y) And (Y <= Label1.Height - 50)If MouseNotExit Then Me.Label1.ForeColor = &HFF0000
'SetCapture Picture1.hWnd
Else
'ReleaseCapture
Me.Label1.ForeColor = &H0End IfEnd Sub
2。鼠标移动到label上边,字体变色,加下划线,如有可能鼠标形状变为手型
3。点击鼠标左健,字体变色,启动ie(见上面大虾的回答)
4。鼠标移开,恢复原状(别忘了判断是否按下左健移开的)。