For Newbie

Tuesday, 15 November 2011

Moving a Form Without the Caption / Title Bar ( Delphi )


How to move a form without dragging the caption bar.

Place the following code in Delphi visual component that has event onmousedown:
ReleaseCapture;
SendMessage (Form1.Handle, WM_SYSCOMMAND, $ F012, 0);

Example of implementation:
TForm1.FormMouseDown procedure (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
   ReleaseCapture;
   SendMessage (Form1.Handle, WM_SYSCOMMAND, $ F012, 0);
end;

Share on Facebook
Share on Twitter
Share on Google+

Related : Moving a Form Without the Caption / Title Bar ( Delphi )