On a form I put down 1 x TCategoryPanelGroup
object and added 3 TCategoryPanel
to it. In a routine, I need to go through each of TCategoryPanel
and through each object onto those panel to produce an output.
So, here is the code ... why into the second FOR instead of giving me classname of each component (i.e. TButton
, TLabel
, etc) it gives out a TCategoryPanelSurface
?
Short question: How can I access each controls from each TCategoryPanel?
procedure TForm1.Button2Click(Sender: TObject);
var i,i2 : integer;
begin
for i := 0 to CategoryPanelGroup1.ControlCount-1 do
begin
showMessage((CategoryPanelGroup1.Controls[i] as TCategoryPanel).caption ) ;
for i2 := 0 to (CategoryPanelGroup1.Controls[i] as TCategoryPanel).ControlCount-1 do
begin
showMessage((CategoryPanelGroup1.Controls[i] as TCategoryPanel).Controls[i2].ClassName);
end;
end;
end;