Created
March 26, 2013 21:55
-
-
Save facebookegypt/5249678 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'API to move windowless form | |
Private Const HTCAPTION As Long = 2 | |
Private Const WM_NCLBUTTONDOWN As Long = &HA1 | |
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 Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) | |
'Moving the form using mouse button from any location on the form held with mouse | |
If Button = 1 Then | |
ReleaseCapture | |
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0& | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment