我好郁闷呀。。。。。。。^<>^
请教各位:application的用法。
一下是一个修改几个button.caption的小程序,为什么写成以下就可以
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to ComponentCount-1 do
begin
if Components[i] is Tedit then
Tedit(Components[i]).text:='Hello';
end;
end;
而写成以下就不行了呢?
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Application.ComponentCount-1 do
begin
if Application..Components[i] is Tedit then
Tedit(Application.Components[i]).text:='Hello';
end;
end;