Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving a Form Around
#1
Do anybody have the declares and such to move a form around when pressing and draging a label? I have a piece of code but its target based and not so good.
Reply
#2
Thanks Smile But I already had this one figured out. I'd suggest you post it in the feature tutorial.
Reply
#3
Magnus Wrote:Here we go:

Add this to modDeclares:

Code:
'Move Form Declares
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Add this somewhere. I have a modMenu with the menu code, but wherever is fine:

Code:
Public Sub MoveForm(F As Form)
    ReleaseCapture
    SendMessage F.hWnd, WM_NCLBUTTONDOWN, 2, 0
End Sub

Now finally, on frmMirage add this to Form Mousedown or Label Mousedown:

Code:
Call MoveForm(Me)

There you go. Have fun.

He posted the question... how many months ago?
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)