Главная страница | назад





Article #17652: How to do Multi Columns in a TListWindow

 Question and Answer Database

FAQ2652C.txt   How to do Multi Columns in a TListWindow
Category   :OWL
Platform    :All
Product    :BC++  5.x

Question:
How do I use a TlistWindow, and display multi columns in the 
control?


Answer:
In order to display more than one column, you need to do a 
couple things:

First you will need to create the TListWindow, with more that
one column, for example:

TListWindow list;
list.InsertColumn(0, TListWindowColumn("First Column", 100));
list.InsertColumn(0, TListWindowColumn("Second Column", 100));

Next you will need to insert items, that have more than one
column, for example:

TListWindItem item("Item Text");
list.InsertItem(item);
// Fill in the second column
item.SetSubItem(1);
item.SetText("Column 2");
list.SetItem(item);

The columns will only show up when the list is displayed in 
detail mode, for example:

list.ModifyStyle(LVS_TYPEMASK, LVS_REPORT);

5/18/98 8:45:16 AM
 

Last Modified: 01-SEP-99