Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TListBox & Objects

0 views
Skip to first unread message

Jaboos

unread,
Apr 13, 2002, 11:43:53 AM4/13/02
to
Hi
How can you store a record or class in the objects property of items?
For example: I would like to store the following information for each item
in the list:

TLocation = class
private
La,
Lo: String;
end;

Actually, I manage to store the information using "AddObject()" method,
_but_ I couldn't retreive it to draw on screen!!!

Any kind of help appreciated...
Regards
Jaboos

Vannus

unread,
Apr 23, 2002, 11:25:35 PM4/23/02
to
It's something like this.

LocationIndex:=TListBox1.AddObject('Location 1',Location1);
{that's your location in}

Location1:=TListBox1.Objects[LocationIndex];
{that's your location out}

If your wanting to do that with something other than TObject (say,
TComponent) then the out is different below...

Location1:=TComponent(ListBox1.Objects[LocationIndex]);
{that's your location out}

Vannus.


"Jaboos" <saf...@hotmail.com> wrote in message
news:a99joi$63...@news.emirates.net.ae...

0 new messages