CListCtrl
-
I have a ClistCtrl with three columns how do i select wich colum i want to insert my string. Each time i insert a String it is inserted in the same column (1): int a; a = m_F.m_SN.GetCount()-1; while (a>0) { S = m_F.m_SN.GetAt(m_F.m_SN.FindIndex(a)); CLC.InsertItem(a,S.SNUPS,0); CLC.InsertItem(a,S.SNRand,1); CLC.InsertItem(a,S.SNDevice,2); a--; } /\|-||\/|/\|)
-
I have a ClistCtrl with three columns how do i select wich colum i want to insert my string. Each time i insert a String it is inserted in the same column (1): int a; a = m_F.m_SN.GetCount()-1; while (a>0) { S = m_F.m_SN.GetAt(m_F.m_SN.FindIndex(a)); CLC.InsertItem(a,S.SNUPS,0); CLC.InsertItem(a,S.SNRand,1); CLC.InsertItem(a,S.SNDevice,2); a--; } /\|-||\/|/\|)
You have to fill the LVITEM structure:
LVITEM lvi; CString csText = "Hi !!"; lvi.iItem = 0; //row lvi.iSubItem = 1; // column lvi.mask = LVIF_TEXT; // for only text. lvi.pszText = csText.GetBuffer(0); CLC.InsertItem(&lvi);
For a complete guide Using the List Control [^] I hope it helps, Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits. -
I have a ClistCtrl with three columns how do i select wich colum i want to insert my string. Each time i insert a String it is inserted in the same column (1): int a; a = m_F.m_SN.GetCount()-1; while (a>0) { S = m_F.m_SN.GetAt(m_F.m_SN.FindIndex(a)); CLC.InsertItem(a,S.SNUPS,0); CLC.InsertItem(a,S.SNRand,1); CLC.InsertItem(a,S.SNDevice,2); a--; } /\|-||\/|/\|)
Hi, InsertItem, adds an item to the listcontrol, this is a full line in the list view and is in fact the text of the first column. The text in the other columns (2 and further) is call subitems. int nIndex = 1; nIndex = c_listcontrol.InsertItem(nIndex, "placed in first column"); // use the new index because we dont know where the actual item is added in the listview, // due to sorting and so. // add to second column, 1: subindex is zero based c_listcontrol.SetItemText(nIndex, 1, "placed in second column"); // add to third column, 2: c_listcontrol.SetItemText(nIndex, 2, "placed in third column"); Regards Kurt Pattyn codito ergo sum
-
Hi, InsertItem, adds an item to the listcontrol, this is a full line in the list view and is in fact the text of the first column. The text in the other columns (2 and further) is call subitems. int nIndex = 1; nIndex = c_listcontrol.InsertItem(nIndex, "placed in first column"); // use the new index because we dont know where the actual item is added in the listview, // due to sorting and so. // add to second column, 1: subindex is zero based c_listcontrol.SetItemText(nIndex, 1, "placed in second column"); // add to third column, 2: c_listcontrol.SetItemText(nIndex, 2, "placed in third column"); Regards Kurt Pattyn codito ergo sum
-
You have to fill the LVITEM structure:
LVITEM lvi; CString csText = "Hi !!"; lvi.iItem = 0; //row lvi.iSubItem = 1; // column lvi.mask = LVIF_TEXT; // for only text. lvi.pszText = csText.GetBuffer(0); CLC.InsertItem(&lvi);
For a complete guide Using the List Control [^] I hope it helps, Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.