October 11th, 2012, 03:03 AM
I have installed this component
and in my form I have sereval sliders.
How could I make a for cycle to set them all OFF?
October 11th, 2012, 11:45 PM
you could cycle through all the components on the form, and test to see if it's the component type you are looking for. If true, cast the component to the type, and turn it off.
for I := 0 to ComponentCount - 1 do//cycle through all components
if Components[I] is TOnOffSwitch then//test for component type
TOnOffSwitch(Components[I]).Off := False;//if it is the correct type, cast components[I] as the type and turn it off