s_vitaly
s_vitaly

Reputation: 43

How to dynamically add panels to TCategoryPanelGroup?

How to dynamically I can add panels to an TCategoryPanelGroup.

Give me a example please, thanks.

This i tried so far.

procedure TWForm.BitBtn3Click(Sender: TObject);
var 
  categorypanel: tcategorypanel;
begin
  categorypanel := categorypanel.Create (categorypanelgroup1);
  categorypanel := tcategorypanel.Create(self);
  categorypanel.caption:=edit1.text;
end;

Upvotes: 4

Views: 5818

Answers (1)

RRUZ
RRUZ

Reputation: 136431

You must create the component and then set the PanelGroup property of the CategoryPanel with the CategoryPanelGroup.

Var
 LPanel : TCategoryPanel;
begin
 LPanel:=TCategoryPanel.Create(CategoryPanelGroup1);
 LPanel.Caption:='My Panel';
 LPanel.PanelGroup:=CategoryPanelGroup1;
end;

Upvotes: 10

Related Questions