sijin 发表于 2008-11-24 22:09

实现无边框移动

im i, x1 As Double, y1 As Double, x2 As Double, y2 As Double
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = 1
x1 = X
y1 = Y

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If i = 1 Then
x2 = X - x1+form1.left
y2 = Y - y1+form1.top
form1.move x2,y2

End If
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
i = 0

End Sub

261001126 发表于 2008-11-25 00:17

Thanks.......nice!

Richer 发表于 2008-12-19 20:18

恩,谢谢啦

rock_out 发表于 2009-4-2 10:52

这是一个很经典的问题。有很多种方法,如调用API

但是如果窗体被一些控件填满了,怎样在控件上拖动窗体呢?
页: [1]
查看完整版本: 实现无边框移动