我根据一列的数据查找在第几行,例如姓名这一列有个人叫小a,我能根据小a查到他的信息在第几行求代码,求函数,哎,以前用过忘记了

解决方案 »

  1.   

    有这个函数吗,我只能用循环查到行数,不用循环搞不定,不知道listctrl自带这个函数不.
      

  2.   

    用循环就可以了。listctrl不带这样的函数
      

  3.   


    int FindItem(
       LVFINDINFO* pFindInfo,
       int nStart = -1 
    ) const;
      

  4.   

    // The pointer to my list view control.
    extern CListCtrl* pmyListCtrl;
    // The string to match.
    extern LPCTSTR lpszmyString;LVFINDINFO info;
    int nIndex;info.flags = LVFI_PARTIAL|LVFI_STRING;
    info.psz = lpszmyString;// Delete all of the items that begin with the string lpszmyString.
    while ((nIndex=pmyListCtrl->FindItem(&info)) != -1)
    {
       pmyListCtrl->DeleteItem(nIndex);
    }