GetFirstSelectedItem GetNextSelectedItem int GetNextSelectedItem( POSITION& pos ) const;Return ValueThe index of the next selected item in the list view control.
GetFirstSelectedItemPosition GetNextSelectedItem int GetNextSelectedItem( POSITION& pos ) const;Return ValueThe index of the next selected item in the list view control.
添加类向导使控件处理鼠标消息响应 例如: void OnRclickList2(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; // TODO: Add your control notification handler code here //pNMListView->iItem行数 //pNMListView->iSubItem列数
*pResult = 0; }
Use CListCtrl::GetFirstSelectedItemPosition() to get the first selected item - if any. With CListCtrl::GetNextSelectedItem() you may iterate thru all selected items or refuese deletion if more than one is selected.
int row = m_MainList.GetNextItem(-1,LVNI_SELECTED);
GetNextSelectedItem int GetNextSelectedItem( POSITION& pos ) const;Return ValueThe index of the next selected item in the list view control.
GetNextSelectedItem int GetNextSelectedItem( POSITION& pos ) const;Return ValueThe index of the next selected item in the list view control.
例如:
void OnRclickList2(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
//pNMListView->iItem行数
//pNMListView->iSubItem列数
*pResult = 0;
}