CListCtrl::FindItem
搜索指定属性的列表视图项。
int FindItem(
LVFINDINFO* pFindInfo,
int nStart = -1
) const;
参数
pFindInfo
对包含有关项目的 LVFINDINFO 结构的指针信息将搜索。nStart
开始搜索的索引与或-1开始。 如果 nStart 不是等于-1,在 nStart 将项目从搜索被排除。
返回值
索引项,如果成功或-1否则为。
备注
pFindInfo 参数指向 LVFINDINFO 结构,包含一些信息搜索列表视图项。
示例
LVFINDINFO info;
int nIndex;
info.flags = LVFI_PARTIAL|LVFI_STRING;
info.psz = _T("item");
// Delete all of the items that begin with the string.
while ((nIndex = m_myListCtrl.FindItem(&info)) != -1)
{
m_myListCtrl.DeleteItem(nIndex);
}
要求
Header: afxcmn.h