procedure TForm1.CloseQuery(var CanClose : Boolean); begin CanClose := FAllowUserCloseForm; // флаг возможн. закрытия. end;