Hi,
I am a newbie. I have several TEdit controls in a form. How would I change the properties of all of them simultaneously? For example, I want to change the enable property of dit1, Edit2, Edit3, .... simultaneously.
Use the Form's Components and ComponentCount properties:
Code:
var
i: Integer;
begin
for i := 0 to Self.ComponentCount - 1 do
if Components[i] is TEdit then
(Components[i] as TEdit).Enabled := False;
end;
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.