drag form by grabbing form or a control (Sticky Form)

Hello,

I want to make my form movable by grabbing the form or one of the controls.

IE: no titlebar
LVL 3
fibdevAsked:
Who is Participating?
 
TNameConnect With a Mentor Commented:

Hi, try this in the form's  (or any of the form's controls) MouseDown procedure (change 'Form1' accordingly):

//if Button=mbLeft then begin   {if the form shouldn't be movable by pressing the right mouse button...}
 ReleaseCapture;
 SendMessage(Form1.Handle, WM_SYSCOMMAND, $F012, 0);
//end;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.