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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multicolumn listbox 2

Status
Not open for further replies.

khowell78737

Programmer
Nov 18, 2003
22
US
I want to have a listbox or checklist box that contain mutiple columns of data populated by data from a DataReader.

I would like the data to be presented something like:

12/12/04 (row 0 col 0); $250.00 (row 0 col 1)
12/13/04 (row 1 col 0); $500.00 (row 1 col 1)

and so on..

I think I understand how to populate the control with one column using "items.add", but I do not understand how I create additional columns in each row. I don't seem to see the column or row properties.

Thanks for your help, again!
Kevin Howell
 
try using a listview or even a datagrid and then come back for more.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
A ListView is the best idea if it will fit your needs. But to make the items appear as your wish.....you can simply code something like:

Code:
ListBox1.Items.Add(DataReader.Item("Column1") & ";" & DataReader.Item("Column2"))
 
Can you make a multicolumn TreeView the same way?

Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
I don't understand what a multi-column TreeView would mean. It's heirchical in nature....so I'm not sure what you would be wanting to do.
 
In WinMX there is a multiColumn TreeView...

The Root Nodes can be sorted by the data in the columns...
...Name if file, who you are downloading from, Size of file, download rate, etc...

And can be expanded to show who all you are downloading from...

Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
you can do a google image search for "winmx" and see some examples...

here is one:

winmx.gif


Have Fun, Be Young... Code BASIC
-Josh

cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Ohh.....that's kind of like how the DataGrid works. It looks more like a ListView to me. I'm sure there are controls you can download that are written for .Net.
 
You can also override the DrawItem Method of the Listbox, to display whatever you want. It needs an understanding of the way the graphics class works, but it is something well worth spending time getting to know your way around. I've done this with both the ListBox and the Combo Box to very useful effect.



Sweep
...if it works dont mess with it
 
Thank you, that was exactally the direction I was needing to be pushed...

Kevin Howell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top