vb 中 image控件的 picture能随鼠标移动?
我要picture随鼠标移动而跟随着鼠标移动。并且,当松开鼠标时,picture又回到image中,松开鼠标时的作标x,y我也要得到!用mouse和api都行。。。。(只...
我要picture 随鼠标移动而跟随着鼠标移动。并且,当松开鼠标时,picture 又回到image 中,松开鼠标时的作标x,y我也要得到!用mouse和api都行。。。。(只有28分了,挨,帮帮忙)
OK 我知道怎么办了 现在有个新问题MouseUp 的坐标 时SINGLE型的XY 但是我需要的是LONG 长整形的XY 这要怎么办 展开
OK 我知道怎么办了 现在有个新问题MouseUp 的坐标 时SINGLE型的XY 但是我需要的是LONG 长整形的XY 这要怎么办 展开
展开全部
dim down As Boolean
Private Sub Pic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
down = True
End Sub
Private Sub Pic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If down = True Then picture1.left=x:picture1.top=y
End Sub
Private Sub Pic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
down = False
picture1.top='原位置
picture1.left='原位置
End Sub
坐标不用管,直接当成long就行了
Private Sub Pic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
down = True
End Sub
Private Sub Pic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If down = True Then picture1.left=x:picture1.top=y
End Sub
Private Sub Pic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
down = False
picture1.top='原位置
picture1.left='原位置
End Sub
坐标不用管,直接当成long就行了
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询