
November 1st, 2012, 11:59 AM
|
|
Contributing User
|
|
Join Date: Sep 2008
Posts: 44
Time spent in forums: 10 h 7 m 32 sec
Reputation Power: 5
|
|
Read this before:
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Controls_TWinControl.html
http://delphi.about.com/od/vclusing/a/parent_enabled.htm
In essence, the TWinControl is the base class for all Delphi control that can accept focus. For example, TEdit is a descendant of the TWinControl, TLabel is not.
Another way for your needed:
procedure or functions
//////////////////////////////
var
xCmp:TComponent;
For I:= n1 TO nZ do
begin
xCmp:= nil; //for better control of "conditions"
xCmp:= FindComponent(format('Player%d_edit',[i]));
if (xCmp<>nil) and (xCmp is TCustomEdit) then
xCmp.Text := Format('Player%d', [i]);
end;
|