Hi all
I am trying to create ClistCtrl with check boxes and different columns in it.
BUT
ListCtrl m_listBox;
int
i;
CString strTemp;
m_listBox.Create(WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_HSCROLL, CRect(10,10,200,200),this, 111);
m_listBox.InsertColumn(0, _T("Column 1") , LVCFMT_LEFT, 50, 0);
m_listBox.InsertColumn(1, _T("Column 2") , LVCFMT_CENTER, 100, 1);
m_listBox.InsertColumn(2, _T("Column 3") , LVCFMT_RIGHT, 100, 2);
m_listBox.SetExtendedStyle(m_listBox.GetExtendedStyle()|LVS_EX_CHECKBOXES | LVS_REPORT );
for(i = 0; i < 10; i ++)
{
strTemp.Format(_T("item"), i + 1);
m_listBox.InsertItem(i, strTemp, 0);
strTemp.Format(_T("Subitem"), i + 1);
m_listBox.SetItemText(i, 1, strTemp);
strTemp.Format(_T("SubSubitem"), i + 1);
m_listBox.SetItemText(i, 2, strTemp);
}
after using this code i can see repetition of "item" with check boxes in single column.
please tell me what is wrong OR just write few lines of code for me.
regards
Abid