1个回答
展开全部
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim MouseEnter As Boolean
MouseEnter = (0 <= X) And (X <= Picture1.Width) And (0 <= Y) And (Y <= Picture1.Height)
If Not MouseEnter Then
Picture1.MousePointer = 0
ReleaseCapture
End If
End Sub
Private Sub Picture1_Click()
Picture1.MousePointer = 99
'自定义鼠标指针此处为99,MouseIcon需设置
SetCapture Picture1.hwnd
End Sub
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim MouseEnter As Boolean
MouseEnter = (0 <= X) And (X <= Picture1.Width) And (0 <= Y) And (Y <= Picture1.Height)
If Not MouseEnter Then
Picture1.MousePointer = 0
ReleaseCapture
End If
End Sub
Private Sub Picture1_Click()
Picture1.MousePointer = 99
'自定义鼠标指针此处为99,MouseIcon需设置
SetCapture Picture1.hwnd
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询