关于窗体拖动(急死人啦!!!!!!!!)
在做无标题窗体拖动!
为什么在sendmessage这句代码前要先释放鼠标?
其实这应该也算是API的问题了吧。
[解决办法]
参考:
http://topic.csdn.net/t/20021107/16/1157096.html
[解决办法]
不用API,也一样可以拖动无标题窗体。使用 form 的 MouseDown、MouseUp 和 MouseMove 事件配合:
Private moveMe As Boolean
Private moX As Long, moY As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
moX = X
moY = Y
moveMe = True
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If moveMe Then Me.Move Me.Left - moX + X, Me.Top - moY + Y
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
moveMe = False
End Sub