主题:如何实现控件移动,谢了
如何使控件象设计时那样鼠标拖动(blackbox为picture控件)
我编的程序错哪了?
Private Sub blackbox_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
黑箱mousedown = 1
黑箱mousex = x + blackbox.Left
黑箱mousey = y + blackbox.Top
End If
End Sub
Private Sub blackbox_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If 黑箱mousedown = 1 Then
blackbox.Top = Abs(y - 黑箱mousey)
blackbox.Left = Abs(x - 黑箱mousex)
Else
End If
End Sub
Private Sub blackbox_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
黑箱mousedown = 0
我编的程序错哪了?
Private Sub blackbox_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
黑箱mousedown = 1
黑箱mousex = x + blackbox.Left
黑箱mousey = y + blackbox.Top
End If
End Sub
Private Sub blackbox_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If 黑箱mousedown = 1 Then
blackbox.Top = Abs(y - 黑箱mousey)
blackbox.Left = Abs(x - 黑箱mousex)
Else
End If
End Sub
Private Sub blackbox_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
黑箱mousedown = 0