Changing panel's Height in constructor doesn't work. lazarus / 10-Designer ---------------------------------------------------------------------- Elphi · 2007-12-10 11:26 I'm porting a component derived from TCustomPanel from Delphi. In its constructor property Height is changed from default 50 to 28. But the change is not visible designtime nor runtime. Any ideas? ---------------------------------------------------------------------- Leledumbo · 2007-12-10 11:34 How does the code do it? I mean, post it here. ---------------------------------------------------------------------- Elphi · 2007-12-10 15:34 Code: [Select]   TYCTogglePanel = class(TCustomPanel)   private     FOnAfterClose,     FOnAfterOpen,     FOnBeforeClose,     FOnBeforeOpen: TNotifyEvent;     FStatus: TYCTogglePanelStatus;     FLocked: Boolean;     FIsOpen: Boolean;     FHeightOpen: Integer;     FHeightClosed: Integer;     FResizeParent: Boolean;     procedure SetHeightOpen(const AValue: Integer);     procedure SetHeightClosed(const AValue: Integer);     procedure SetIsOpen(const AValue: Boolean);     function GetStatus: TYCTogglePanelStatus;     procedure SetStatus(const AValue: TYCTogglePanelStatus);   protected     procedure DblClickPanel(Sender: TObject);     procedure ParentResize;   public     constructor Create(AOwner: TComponent); override;     procedure Toggle;     procedure Open;     procedure Close;     property ResizeParent: Boolean read FResizeParent write FResizeParent default True;     property Locked: Boolean read FLocked write FLocked default False;     property HeightOpen: Integer read FHeightOpen write SetHeightOpen;     property HeightClosed: Integer read FHeightClosed write SetHeightClosed;     property IsOpen: Boolean read FIsOpen write SetIsOpen default True;   published     property Align;     property BevelOuter;     property Color;     property TabOrder;     property Status: TYCTogglePanelStatus read GetStatus write SetStatus;     property OnAfterClose: TNotifyEvent read FOnAfterClose write FOnAfterClose;     property OnAfterOpen: TNotifyEvent read FOnAfterOpen write FOnAfterOpen;     property OnBeforeClose: TNotifyEvent read FOnBeforeClose write FOnBeforeClose;     property OnBeforeOpen: TNotifyEvent read FOnBeforeOpen write FOnBeforeOpen;   end; {TYCTogglePanel}   procedure Register; implementation uses   Controls,   YCStyling, YCFonts, YCResource; constructor TYCTogglePanel.Create(AOwner: TComponent); begin   inherited Create(AOwner);   FIsOpen := True;   FLocked := False;   FResizeParent := True;   FHeightOpen := 12;   FHeightClosed := 6;   HeightOpen := 28;       HeightClosed := 6;       Color := cDfltFuncPnlCol;   Font.Name := DefaultFontName;   Anchors := [akLeft, akRight, akBottom];   BevelOuter := bvLowered;   Align := alBottom;   FStatus := tpsOpenNotLocked;   OnDblClick := DblClickPanel; /// Height := 28; This doesn't work either.   Parent := AOwner as TWinControl; end; . . . procedure TYCTogglePanel.SetHeightOpen(const AValue: Integer); begin   if (AValue = FHeightOpen) or (AValue <= FHeightClosed) then     Exit;   FHeightOpen := AValue;   if IsOpen then     Height := FHeightOpen; end; procedure TYCTogglePanel.SetHeightClosed(const AValue: Integer); begin   if (AValue <> FHeightClosed) or  (not (AValue in [0..Pred(HeightOpen)])) then     Exit;   FHeightClosed := AValue;   if not IsOpen then     Height := FHeightClosed; end; ---------------------------------------------------------------------- Elphi · 2007-12-10 18:28 Solved? Removed the component and put a new one on the form. Now it works as intended. Is this intended behavior?