vb的mousemove事件被挡住了

来源:百度知道 编辑:UC知道 时间:2024/06/17 14:58:25
我做了个shape跟随鼠标移动
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Shape1.Left = X - Shape1.Width / 2: Shape1.Top = Y - Shape1.Height / 2
End Sub
但是如果有一个label,当鼠标移到上面去的时候,shape就不动了,怎么解决?

在你的所有空间的mousemove事件上都加上“Shape1.Left = X - Shape1.Width / 2: Shape1.Top = Y - Shape1.Height / 2”,这样不管多少个空间都挡不住

加一个
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form_MouseMove Button, Shift, X, Y
End Sub

你可以试一试在Label的MouseMove事件中添加一个移动事件,于Form的移动事件相协调运作(我还没试过)