Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Move form without using title bart


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 Long ) As Long
Const HTCAPTION = 2
Const WM_NCLBUTTONDOWN = &HA1

'place this in a MouseDown event
    Dim iReturn As Long
    If Button = 1 Then   ' Checking for left button only
      iReturn = ReleaseCapture()
      iReturn = SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
    End If