怎么实现在Edit控件中输入要查找的信息,找到后的所有行信息移动到列表的最顶端。
此查找类似于QQ界面上的查找。
比如我要输入的值为 张三,则输入 张 时显示有张的行信息,输入 张三 时显示有张三的信息。
注意:列表里的原来所有的信息仍然都在列表里显示,只是改变了一些顺序。
急,求救。

解决方案 »

  1.   

    BOOL GetItem(
       LVITEM* pItem 
    ) const;
    通过该函数遍历出有张的行信息,
    然后显示这些信息,其它的信息不显示
      

  2.   

    调用CListCtrl的FindItem
    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);
    }
      

  3.   

    之前写的一个工具,可以满足你的要求。
    1.拖动文件到窗口可以添加一项。
    2.搜索时采用模糊匹配,输入拼音可以自动匹配中文名
    http://cid-3ba16e78a53d2d3d.office.live.com/self.aspx/VC%5EM%5EM/EasyFind.zip