for I := 0 to self.ControlCount-1 do begin if controls[i] is Tlabel then begin controls[i] as Tlabel; ShowMessage(Tlabel(Controls[i]).caption); end; end;
for I := 0 to self.ComponentCount-1 do begin if Components[i] is Tlabel then begin Components[i] as Tlabel; ShowMessage(Tlabel(Components[i]).caption); end; end; [Delphi] property Components: TComponent read GetComponent; Description Use Components to access any of the components owned by this component, such as the components owned by a form. The Components property is most useful when referring to owned components by number rather than name. It is also used internally for iterative processing of all owned components.
for I := 0 to self.ControlCount-1 do begin if controls[i] is Tlabel then begin controls[i] as Tlabel; if Tlabel(Controls[i]).caption='label1' then ShowMessage(Tlabel(Controls[i]).caption); end; end;
begin
if controls[i] is Tlabel then
begin
controls[i] as Tlabel;
ShowMessage(Tlabel(Controls[i]).caption);
end;
end;
begin
if Components[i] is Tlabel then
begin
Components[i] as Tlabel;
ShowMessage(Tlabel(Components[i]).caption);
end;
end;
[Delphi] property Components: TComponent read GetComponent;
Description
Use Components to access any of the components owned by this component, such as the components owned by a form. The Components property is most useful when referring to owned components by number rather than name. It is also used internally for iterative processing of all owned components.
Index ranges from 0 to ComponentIndex minus 1.
begin
if controls[i] is Tlabel then
begin
controls[i] as Tlabel;
if Tlabel(Controls[i]).caption='label1' then
ShowMessage(Tlabel(Controls[i]).caption);
end;
end;
http://www.delphifans.com/SoftView/SoftView_550.html
^_^
gettext()