You can drag and drop a form using any contained control, including yourself.
Using the following example, you can move a form by clicking on its canvas and dragging it. You can do the same with the form panel by placing the same code in the MouseDown panel event, which allows you to create your own pseudo-header panel.
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); const SC_DRAGMOVE = $F012; begin if Button = mbLeft then begin ReleaseCapture; Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0); end; end;
Bruce mcgee
source share