Question: I'm working on a program, which should list all files and it's size(for now...). I created a simple application, which should write the data to a listbox. I'm trying to write the data in two columns(the first should be the name, and next to it, in an other column, it's size), but i can't figure out, how should i do this.
Can someone help me?

Thanks in advance!

kampi

Update:

I try to use ListControl., but unfortunately i can't. I can succesfully compile my App, but i can only see, the empty rectangle. Does someone know what i am doing wrong?

```
BOOL CGetFileListDlg::OnInitDialog()
{  
CDialog::OnInitDialog();

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE);         // Set big icon
SetIcon(m_hIcon, FALSE);        // Set small icon

// TODO: Add extra initialization here

LVITEM lvItem;
LVCOLUMN lvColumn;
int nCol;

lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
lvColumn.fmt = LVCFMT_CENTER;
lvColumn.cx = 10;
lvColumn.pszText = _T("Filename");
ListView_InsertColumn( m_List, 0, &lvColumn ); 
ListView_SetItemText( m_List, 0, 0, _T("TEST") );

return TRUE;  // return TRUE  unless you set the focus to a control    
}

```

Answer: 
Don't use a List Box, use a [List Control](http://www.functionx.com/visualc/controls/listcontrol.htm) with LVS\_REPORT style.
Three important parameters to be checked are 

1. List Box or the List Control (List Control is to be used)
2. View parameter must be Report mode
3. Owner Data must be set to False
The screenshot shows these
[![enter image description here](https://i.stack.imgur.com/JeSgO.png)](https://i.stack.imgur.com/JeSgO.png)

The programming flow to add data to list control are Change the list Control to extended list view(`ListView_SetExtendedListViewStyle`), Create the layout(By adding columns), Add Item data (for each row needed) & add finally add sub-item to each column (for each item data added previously).