iSubItem always = 0 on many ListCtrl Events
-
In a report style CListCtrl with multiple columns, I have traced on many CListCtrl events that the iSubItem of many ListCtrl STRUCTS is always zero eventhough the current subitem selected is on the columns other than the 1st column... For example:
void CResultsFormView::OnLvnItemchangedMyList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); NMLVCUSTOMDRAW* pn=(NMLVCUSTOMDRAW*)pNMHDR; NMITEMACTIVATE* nm=(NMITEMACTIVATE*)pNMHDR; LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; int item=temp->iItem; int subitem=temp->iSubItem; //even if used all of those STRUCTS //subitem is always zero... }
Any thoughts on this problem... "mustang this is ghostrider, requesting flyby..." -
In a report style CListCtrl with multiple columns, I have traced on many CListCtrl events that the iSubItem of many ListCtrl STRUCTS is always zero eventhough the current subitem selected is on the columns other than the 1st column... For example:
void CResultsFormView::OnLvnItemchangedMyList(NMHDR *pNMHDR, LRESULT *pResult) { LPNMLISTVIEW pNMLV = reinterpret_cast(pNMHDR); NMLVCUSTOMDRAW* pn=(NMLVCUSTOMDRAW*)pNMHDR; NMITEMACTIVATE* nm=(NMITEMACTIVATE*)pNMHDR; LPNMITEMACTIVATE temp = (LPNMITEMACTIVATE) pNMHDR; int item=temp->iItem; int subitem=temp->iSubItem; //even if used all of those STRUCTS //subitem is always zero... }
Any thoughts on this problem... "mustang this is ghostrider, requesting flyby..."Hello You can not select other than the 1st columns item in ListCtrl. The selection is always on the first column or it can be the whole row if you specified an appropriate style. So, for item changed event (and for most list control events) the subitem member will be 0. Andrew