int nItem = -1; POSITION pos = m_AgainList.GetFirstSelectedItemPosition(); if(pos != NULL) { nItem = m_AgainList.GetNextSelectedItem(pos); }
我的意思是单击或双击一项,返回相应的Item.
GetItemText GetItemData GetItem
CListCtrl::GetSelectionMark This method retrieves the selection from a list view control. This method implements the behavior of the Windows CE macro LISTVIEW_GETSELECTIONMARK. You can use this macro or explicitly send the LVM_GETSELECTIONMARK message.int GetSelectionMark( );
int GetItemText( int nItem, int nSubItem, LPTSTR lpszText, int nLen ) const GetItemData( int nItem ) const; 我现在要的就是 nItem得值。
int GetSelectionMark( );Return Value The zero-based selection , or -1 if there is no selection .如何得到nItem
int nItem = -1; POSITION pos = m_AgainList.GetFirstSelectedItemPosition(); if(pos != NULL) { nItem = m_AgainList.GetNextSelectedItem(pos); } ----------------------- 这里不是有了吗? 你选中一个就有一个,选种多了,改改代码把if改成while不就行了?
CListCtrl listctrl; int i=listctrl.GetSelectionMark
{
nItem = m_AgainList.GetNextSelectedItem(pos);
}
GetItemData
GetItem
This method retrieves the selection from a list view control. This method implements the behavior of the Windows CE macro LISTVIEW_GETSELECTIONMARK. You can use this macro or explicitly send the LVM_GETSELECTIONMARK message.int GetSelectionMark( );
GetItemData( int nItem ) const;
我现在要的就是 nItem得值。
The zero-based selection , or -1 if there is no selection .如何得到nItem
{
nItem = m_AgainList.GetNextSelectedItem(pos);
}
-----------------------
这里不是有了吗?
你选中一个就有一个,选种多了,改改代码把if改成while不就行了?
int i=listctrl.GetSelectionMark