Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008

    Unanswered: Drag an Access Form without a Toolbar


    I'm looking to get a little creative with a new Access project I am working and have been researching the possibility of having a custom "UI" for the Access forms.

    I'd like to hide the default form toolbar and replace it with a new one. With that said, I need to figure out how to have a form draggable when he MouseDown event is triggered on the form - Was hoping to find someone that has done something similar and how you went about doing it.


  2. #2
    Join Date
    Jan 2008
    After further research I've found exactly what I was looking for:

    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) As Long
    Private Const WM_NCLBUTTONDOWN = &HA1 
    Private Const HTCAPTION As Long = 2 
    Sub FormDrag(TheForm As Form) 
    Call ReleaseCapture 
    Call SendMessage(TheForm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&) 
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts