如题

解决方案 »

  1.   

    根据指定的字符串在Reprot风格的listctrl中找到所在行LVFINDINFO info;
    int nIndex;info.flags = LVFI_PARTIAL|LVFI_STRING;
    info.psz = lpszmyString;//字符串名nIndex=pmyListCtrl->FindItem(&info)
      

  2.   

    以下是MSDN中关于你说的问题的解决办法:// The pointer to my list view control.
    extern CListCtrl* pmyListCtrl;
    // The pointer where the mouse was clicked.
    extern CPoint myPoint;// Select the item the user clicked on.
    UINT uFlags;
    int nItem = pmyListCtrl->HitTest(myPoint, &uFlags);if (uFlags & LVHT_ONITEMLABEL)
    {
       pmyListCtrl->SetItem(nItem, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, 
          LVIS_SELECTED, 0);
    }
      

  3.   

    多谢 laiyiling,可我试过了,找不出来,nIndex都是-1,lpszmyString是我要找的字符串吗?