Use SendMessage to send the WM_NCLBUTTONDOWN in the HTCAPTION area.
Good luck!Code: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 = 2 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button And vbLeftButton) = vbLeftButton Then ReleaseCapture SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0& End If End Sub




Reply With Quote