I have a TGroupBox with several components inside, I'm trying to set the Enabled property of all components that are inside the GroupBox this way
  for i := 0 to GroupBox1.ComponentCount -1 do if (GroupBox1.Components[i]) is TWinControl then TWinControl(GroupBox1.Components[i]).Enabled:=False; 
but ComponentCount always returns 0, what am I missing?
source share