[Lazarus] TPanel.ComponentCount

ik idokan at gmail.com
Tue Sep 4 21:51:20 CEST 2012


Hello,

I'm trying to do the following code:

for i := 0 to vispan.ComponentCount -1 do
    begin
      if vispan.Components[i] is TSpeedButton then
        begin
          if Assigned(TSpeedButton(vispan.Components[i]).Action) then
            TAction(TSpeedButton(vispan.Components[i]).Action).Enabled := True
          else
            TSpeedButton(vispan.Components[i]).Enabled := True;
        end;
    end;

where vispan is a TPanel that get the current visible panel.
However, it seems that ComponentCount is 0, even though it has 7
components inside.
The components does see the TPanel as it's parent, and so does the navigator.

Is it a bug, or am I missing something here ?

Lazarus 1.1 r38512M FPC 2.6.0 x86_64-linux-gtk 2

Thanks,
Ido




More information about the Lazarus mailing list