Naming object on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I could in Delphi name labels with a number like lblName(1).
This is useful when I'm making functions, it can be used like this:

int i = 0;
if ( a > b)
{
i = 1;
}
lblName(i).Text ="This is a great number";

Is it possible to do something like this, without making a list of objects ?
 
<=?Utf-8?B?S2Fyc3RlbiBMdW5kc2dhYXJk?= <Karsten
Hi, I could in Delphi name labels with a number like lblName(1).
This is useful when I'm making functions, it can be used like this:

int i = 0;
if ( a > b)
{
i = 1;
}
lblName(i).Text ="This is a great number";

Is it possible to do something like this, without making a list of objects ?

No (or at least, not cleanly) - but what do you have against making a
list (or array) of labels?
 
Hi Jon, thanks for the help.

I have nothing against using a list, I would just like to now if there is an
easier way of doing it.

Regards

Karsten
 
Back
Top