Author: Jonas Bilinkevicius
I once saw a very short example of moving a form with the mouse. It's the same like
moving the form with the mouse in the caption of the form, but now it is moveable
with the mouse in the client area. Has anyone an idea how to do this?
Answer:
In the private declarations of the form add this message handler:
1 private2 { Private declarations }3 4 procedure WMNCHitTest(var M: TWMNCHitTest); message WM_NCHITTEST;
5 6 //Then add this procedure7 8 <!--CS-->procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
9 begin10 inherited;
11 if M.Result = htClient then12 begin13 {Client area is hit - but state it is the Title Bar}14 if ((m.ypos - HelpWin.top) < HelpWin.height) then15 M.Result := htCaption;
16 end;
17 end;