Click here to Skip to main content
15,891,184 members
Articles / Programming Languages / Visual Basic
Article

TagItem

Rate me:
Please Sign up or sign in to vote.
1.80/5 (2 votes)
2 Sep 2004 25.2K   376   8   1
How to fill in Text and ID into same ListBox item or "Where is my ItemData".

Introduction

First ListBox control use in .NET was very confusing for me. Like, I am sure many of you, I used ItemData to fill in ID of somekind. But there is no ItemData in Kansas anymore so "Dorothy" had to find another solution.

It took me some time to see that new "Items.Add" formula takes Object as argument. From there, everything was downhill.

By using Text and ID as an argument for constructor, this class can be successfully used to retrieve/change same information later. One additional Object argument is added for "just in case" situations.

Since talk is cheap, try the sample.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Croatia Croatia
VB programmer with MCSD status. Loves chevapi...

Medo's Home Page

Comments and Discussions

 
GeneralMissing Event handler Pin
Ken J13-Sep-04 2:15
Ken J13-Sep-04 2:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.