31 Ocak 2014 Cuma

Form üzerindeki bileşenleri say

Form üzerindeki bileşenleri say ve sonucu göster.
procedure TForm1.Button1Click(Sender: TObject);
var a,e,s:word;
begin
 e:=0;
    s:=0;
begin
   for a:=0 to componentcount -1 do
    if components[a] is tedit  then  e:=e+1;
 end;
Edit4.Text:=(inttostr(e)+'edit');
 begin
  for a:=0 to componentcount -1 do
    if components[a] is TLabel  then  s:=s+1;
 end;
 edit5.Text:=(inttostr(s)+'label');
end;
end.


Hiç yorum yok:

Yorum Gönder