• Welcome to Valhalla Legends Archive.
 

help move? please

Started by RhiNo, December 19, 2002, 11:41 AM

Previous topic - Next topic

RhiNo

can someone help me on moving a freakin form without title bar n what not cause i am workin on bot and thats next thing that need to be done any help would be appreciated

Spht

#1
That sounds fun!

First, add this to your project source:

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
Private Declare Function ReleaseCapture Lib "user32" () As Long

Just some Win32 API functions you'll need for doing this.

Now, you may want to make a function that actually does the moving of the form...

Private Sub MoveForm(frmForm As Form)
    Dim lngRetVal As Long
    
    ReleaseCapture
    lngRetVal = SendMessage(frmForm.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub

Now, create a _MouseDown() event for where you want to click to drag the form. If you want to click the form to do it, then Form_MouseDown(). In here, choose whatever button you want to required to be clicked (idealy left-click) and then call MoveForm().

Grok

#2
You didn't specify how you wanted the form to move.  Due to a user clicking on the form and dragging?  Are you providing your own 'caption' bar and wanting that to be the drag-move substitute?

RhiNo

#3
yea i woulda said thanx earlier but i been sick and still am sorta but thanx