Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to disable form movement using the mouse

   

This is how to prevent a form from being moved using the mouse.

type
  TForm1 = class(TForm)
  private
    { Private declarations }
    procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
  end;

procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);
begin
 inherited;
 with Message do
   if Result = HTCAPTION then
     Result := 0;
end;
Author: Dennis LV
Contributor: Dennis LV
Added: 2007-09-20
Last updated: 2007-09-20

« Return to contents »