Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to dynamically add panels to TCategoryPanelGroup?

Tags:

delphi

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;
like image 962
s_vitaly Avatar asked Dec 28 '22 05:12

s_vitaly


1 Answers

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;
like image 187
RRUZ Avatar answered Jan 21 '23 11:01

RRUZ