--> Moving a Form Without the Caption / Title Bar ( Delphi ) | Delphi Tips Trick

For Newbie

Tuesday, 15 November 2011

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

| Tuesday, 15 November 2011

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;

Related Posts

No comments: