I have a TGroupBox with several components inside, I'm trying to set the Enabled
property of all the components which are inside of the GroupBox in this way
for i := 0 to GroupBox1.ComponentCount -1 do
if (GroupBox1.Components[i]) is TWinControl then
TWinControl(GroupBox1.Components[i]).Enabled:=False;
but the ComponentCount returns always 0, what i'm missing?
The ComponentCount property is for retrieve the number of components owned by a component, to iterate over all the children controls you must use the ControlCount and Controls properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With