Board index » delphi » Label's and Captions and Macros

Label's and Captions and Macros

In my form:
  Label1 : Tlabel;
  Label2 : Tlabel;
  Label3 : Tlabel;
  Label4 : Tlabel;
  Label5 : Tlabel;
...
How i do to send messagens for a caption propretiers of those labels, with
an while loop, also:

   number := 1;
   while number<6 do
       begin
           Label[number].Caption := "... Message...";
           number := number + 1;
       end;

It's possible?

Thanks!!!!

paulo.be...@jfa.zaz.com.br

 

Re:Label's and Captions and Macros


Quote
Paulo Bergo wrote:

> In my form:
>   Label1 : Tlabel;
>   Label2 : Tlabel;
>   Label3 : Tlabel;
>   Label4 : Tlabel;
>   Label5 : Tlabel;
> ...
> How i do to send messagens for a caption propretiers of those labels, with
> an while loop, also:

>    number := 1;
>    while number<6 do
>        begin
>            Label[number].Caption := "... Message...";
>            number := number + 1;
>        end;

> It's possible?

Yeh, it's simple:

  (FindComponent('Label'+IntToStr(number)) as TLabel).Caption := 'What you
want';

HTH
-Michael

Other Threads