2004. június 4., péntek

Disable a form movement


Problem/Question/Abstract:

How can I disable the any form movement?

Answer:

Always I saw a question: how can I move a window by hit in any part of form?
But I never saw a reverse question: how to disable a movement.

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

procedure TyourForm.WMNCHitTest(var Message: TWMNCHitTest);
begin
  inherited;

  with Message do
    if Result = HTCAPTION then
      Result := HTNOWHERE;
end;

Nincsenek megjegyzések:

Megjegyzés küldése