BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Storing custom values as "objects" in combobox

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
StuartDAC
Guest





PostPosted: Sat Feb 14, 2004 4:53 pm    Post subject: Storing custom values as "objects" in combobox Reply with quote



I have a combobox that is displaying strings, but I want to asociate an id with
each item (the text comes from a language file, so I only know the order not
the text). I use Items.AddObject, but cannot read the values back. A quick look
into the Delphi code seems to suggest that the PutObject is empty and therefor
doesn't work as documented. I assume I must be doing something wrong. My code
looks like this:

oCombo.Items.AddObject(sLine1, TObject(100));

and to retriece it:

iID:= Items.IndexOfObject(TObject(100))

But, this causes an out of bounds error.

Can anyone help?

Thanks!
-Stuart
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.