Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Command1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Command1.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End Sub
请说明一下好吗?Thanks.
Picture2.Top = Y
If Picture2.Top > 5100 Then Picture2.Top = 5100
If Picture2.Top < 30 Then Picture2.Top = 30
End Sub