你测试一下这个
Declare Function ReleaseCapture Lib "user32" () As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Sub MovingHandle_MouseDown(Button ...)
If (Button = 1) And (Me.WindowState = 0) Then
*******.MousePointer = 15
ReleaseCapture
SendMessage Me.Hwnd, &H112, &HF010& + 2, 0
*******..MousePointer = 0
End If
Option Explicit
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
Private Const htcaption = 2
Private Const wm_nclbuttondown = &HA1
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i, r
If Button = 1 Then
i = ReleaseCapture()
r = SendMessage(hwnd, wm_nclbuttondown, htcaption, 0)
End If
End Sub
加上这段代码就可以移动了
[此贴子已经被作者于2007-7-23 18:31:27编辑过]