Está en la página 1de 1

if you wish to access and change only certain controls and not all of them, you

can add a number to the tag property and reference that (they may all have the
same tag number)

----------------------------------
var
i : integer;
...

for i := 0 to form1.componentcount-1 do
begin
if (form1.components[i] is tedit) then
if (tedit(form1.components[i]).tag = 1) then
tedit(form1.components[i]).visible := false;
end;

or

for i := 0 to form1.componentcount-1 do
begin
if (form1.components[i] is tedit) then
if (tedit(form1.components[i]).tag in [1..5,10..15]) then
tedit(form1.components[i]).visible := false;
end;

or

for i := 0 to form1.componentcount-1 do
begin
if (form1.components[i] is tedit) then
begin
case tedit(form1.components[i]).tag of
1..14 : tedit(form1.components[i]).visible := false;
15..18 : tedit(form1.components[i]).visible := true;
19..25 : tedit(form1.components[i]).visible := false;
26..30 : tedit(form1.components[i]).visible := false;
end; { case }
end; {if tedit)
end; {i loop }

También podría gustarte