Mega Code Archive

 
Categories / Delphi / Examples
 

Dragging components at run-time

This piece of code shows how to drag a TPanel component Panel1 at run-time: procedure Form1.MouseDown(Sender: Tobject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); const SC_DragMove = $F012; begin ReleaseCapture; Panel1.Perform(WM_SysCommand, SC_DRAGMOVE, 0); end;