locked
Multi Column listbox in Win32 RRS feed

  • Question

  • Hi,

    I want to use a Multi Column listbox in Win32. I have added listbox control using resource editor and I have marked it a Multi-column list box using LBS_MULTICOLUMN.

     

    How can I set the values of different columns of a entry in list Box using Win32 (Not in MFC)?

     

    Any code sample would be great.

     

    Thanks do much.

     

    Pankaj

     

     

    Monday, August 6, 2007 10:09 PM

Answers

  • A multi-column listbox is not what you think. It does not have multiple columns for any item. Each cell is independent of every other cell. The only advantage of a multi-column listbox is to allow more horizontal space to be used for items with relatively small width. Therefore there is no function that supports multi-column listboxes; there is just the style for multi-column listboxes.

    Tuesday, August 7, 2007 2:07 AM

All replies

  • While I've never used that feature myself, I've always assumed the entries are still display left-to-right, top-to-bottom. You just need to set the column width (LB_SETCOLUMNWIDTH)

     

    -hg

    Tuesday, August 7, 2007 12:43 AM
  • A multi-column listbox is not what you think. It does not have multiple columns for any item. Each cell is independent of every other cell. The only advantage of a multi-column listbox is to allow more horizontal space to be used for items with relatively small width. Therefore there is no function that supports multi-column listboxes; there is just the style for multi-column listboxes.

    Tuesday, August 7, 2007 2:07 AM
  •  

    Thanks so much for reply. I used the LIstView control to show multicolumns.

    Pankaj

    Friday, August 10, 2007 9:59 AM