...prevent a Form from Moving/Resizing?

Author: Thomas Stutz

Category: Forms

private
  
procedure 
WMSysCommand(var Msg: TWMSysCommand); message WM_SYSCOMMAND;

  {...}
implementation


procedure 
TForm1.WMSysCommand(var Msg: TWMSysCommand);
begin
  if 
((Msg.CmdType and $FFF0) = SC_MOVE) or
    
((Msg.CmdType and $FFF0) = SC_SIZE) then
  begin
    
Msg.Result := 0;
    Exit;
  end;
  inherited;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base