Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

ListBox Item Objects: what is displayed?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peteroid - 28 Feb 2005 20:08 GMT
I'm going to be using a ListBox in my managed C++ application, and have a
question. Why are the Items you Add to a ListBox in the form of generic
Object*'s? I believe a ListBox displays a table of selectable options via
multiple lines (or columns) of TEXT, so why doesn't Add merely take a
String* ? How does it know what to display (i.e., the text of each Item
listing) with a generic Object* (or do all Object's have some Text property
ListBox knows to display to represent it)? Put more to the point, if I Add
an Item which ISN'T a String*, what does the ListBox display?

Thanks in advance! : )

[==Peteroid==]
mosimu - 01 Mar 2005 00:59 GMT
You should look up DisplayMember and ValueMember, which are listbox
properties.  I have never used it myself but you can use that to control what
is displayed in the listbox.

mosimu

> I'm going to be using a ListBox in my managed C++ application, and have a
> question. Why are the Items you Add to a ListBox in the form of generic
[quoted text clipped - 8 lines]
>
>  [==Peteroid==]
Peteroid - 01 Mar 2005 22:21 GMT
Thanks, I will :)

[==Peteroid==]

> You should look up DisplayMember and ValueMember, which are listbox
> properties.  I have never used it myself but you can use that to control
[quoted text clipped - 17 lines]
>>
>>  [==Peteroid==]

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.