Advertisement

Creating a multi-column Listbox

Started by January 15, 2003 06:33 PM
5 comments, last by mdias 21 years, 10 months ago
Hi, How do I create a multi-column litbox ?? I''m working with resources "DialogBox()" and I''ve defined the multi-column style but when I run my program there''s no columns at all....... How do I make it? Do I need to use CreateWindowex ??? thanx KaMiKaZe
Oh, c''mon guys, I know you know it...

KaMiKaZe
Advertisement
Im not sure how to fix your problem, but maybe if you post some code the other guys here will help out. They are usually very helpful.
specifying a multicolumn style for a standard listbox control does not create what would normally be considered to be a multicolumn listbox. what it causes the control to do is display the added and inserted rows in a newspaper-like fashion, with the rows "wrapping" to a new column once the bottom of the control window is filled. what you end up with is a horizontally scrolling listbox.

to get multiple columns per row, which is what i think you want, you can either set/use tabstops with a standard listbox control, or you can use a listview control. a listview control is the same control used in the righthand pane of Explorer windows. listviews have much more functionality.
quote: Original post by Anonymous Poster
specifying a multicolumn style for a standard listbox control does not create what would normally be considered to be a multicolumn listbox. what it causes the control to do is display the added and inserted rows in a newspaper-like fashion, with the rows "wrapping" to a new column once the bottom of the control window is filled. what you end up with is a horizontally scrolling listbox.

to get multiple columns per row, which is what i think you want, you can either set/use tabstops with a standard listbox control, or you can use a listview control. a listview control is the same control used in the righthand pane of Explorer windows. listviews have much more functionality.


Oh, yeah, that''s true, it creates a thing like in excel, with cells
instead of columns... Is there another control that will do my
clolumns ? I heard of a "ListView" control instead of "ListBox",
it has a struct called "LV_COLUMN" so I think that''s it, well thanx
guys...

KaMiKaZe
quote: Original post by Kamikaze15
Original post by Anonymous Poster
Is there another control that will do my
clolumns ? I heard of a "ListView" control instead of "ListBox",
it has a struct called "LV_COLUMN" so I think that''s it, well thanx
guys…

yes, a ListView control would work for you but it might be overkill. it depends upon what you want to do. if you haven''t used them before then they take a bit of work to get them set up and handled correctly. but once you do then you have a lot of functionality at your fingertips. maybe you should search for a wrapper class to get you started, if you want to use one.
Advertisement
I''m building myself a class for it with the help of:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_chicoapp.asp

It seems pretty easy to do it.

Thanx for replying

KaMiKaZe

This topic is closed to new replies.

Advertisement