[分享]移动无标题窗口的代码(非API编写)
Dim mouseX, mouseY, currX, currY As Single
Dim flag As Boolean
Private Sub Form_Load()
flag = False
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mouseX = X
mouseY = Y
flag = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbKeyLButton And flag = True Then
currX = Me.Left - mouseX + X
currY = Me.Top - mouseY + Y
Me.Move currX, currY
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = False
End Sub
[此贴子已经被作者于2006-12-9 20:06:54编辑过]