Aby przesunąć formę klikając w jakiekolwiek inne miejsce niż tylko pasek tytułu wystarczy skorzystać z komunikatów Windowsa …
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
type TForm1 = class(TForm) public procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.WMNCHitTest(var M: TWMNCHitTest); begin inherited; if M.Result = htClient then M.Result := htCaption; end; |
Autor: Nakiel