VB中图片跟随鼠标
我想用VB实现这样的功能,在VB的窗体中,有一个图片控件,当鼠标坐键按下该控件时,鼠标的指针变成图片控件里的图片,移动鼠标时,该图片也能移动,类似于WindowSpy的探...
我想用VB实现这样的功能,在VB的窗体中,有一个图片控件,当鼠标坐键按下该控件时,鼠标的指针变成图片控件里的图片,移动鼠标时,该图片也能移动,类似于WindowSpy的探针。
展开
2个回答
展开全部
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
with screen
.mousepointer=99
.mouseicon=Picture1.Picture
end with
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then screen.mousepointer=0
End Sub
If Button = 1 Then
with screen
.mousepointer=99
.mouseicon=Picture1.Picture
end with
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then screen.mousepointer=0
End Sub
展开全部
'这个仅对图片为ico、cur等图标格式有效
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then SetCursor Picture1.Picture.Handle
End Sub
Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then SetCursor Picture1.Picture.Handle
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询