ListCtrl中InsertItem的函数实现

功能:该函数实现按列插入值,自动进行换行

 

void AddItem(int iRow, char *pStr, int iRow) { LV_ITEM lvi ; if (iRow == -1) { iRow = m_List.GetItemCount() - 1 ; } if (iCol == 0) { lvi.pszText = pStr ; lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE ; lvi.iItem = m_List.GetItemCount() ; lvi.iSubItem = iCol ; lvi.iImage = 0 ; lvi.stateMask = LVIS_STATEIMAGEMASK ; lvi.state = INDEXTOSTATEIMAGEMASK(1) ; m_List.InsertItem(&lvi) ; } else { if (iRow >= 0 && iCol > 0) { m_List.SetItemText(iRow, iCol, pStr) ; } }

 

你可能感兴趣的:(ListCtrl中InsertItem的函数实现)