Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox - Multicolumn 1

Status
Not open for further replies.

Domino2

Technical User
Joined
Jun 8, 2008
Messages
475
Location
GB
I am filling a listbox :

For ty = 0 To MaxRows - 1
ListBox1.Items.Add(ds.Tables(0).Rows(ty).Item(1))
Next

However I want to add a second column having Rows(ty) and Item (2)

Can someone tell me how:

a) I modify my code to include the second column
b) Have the first column hidden
c) How to have the first column as selected item (contains record ID)

Don't know if its possible when the listbox row is selected
that the whole row highlights instead of just the cell clicked. Hope I have not confused the issue. Thanks
 
This sounds like a job for the ListView control as opposed to the Listbox.
 
Many thanks. It was always easy to do it in MS Access. Just wish all controls were compatable within the MS family. I only ever used a listview conrol once, will have to retrace what I did with it. All good fun.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top