CListBox中有多行信息,用鼠标选中一行。用一个button单击删除所选的那条信息。
在此键中应加什么函数,我用了FindStringExact // The pointer to my list box.extern LPCTSTR lpszmyString;/////此行是添加在button键中马???// Delete all items that exactly match the specified string.
int nIndex = 0;
while ((nIndex=m_listbox.FindStringExact(nIndex, lpszmyString)) != LB_ERR)
{
   m_listbox.DeleteString( nIndex );
}大家有什么好办法快教我

解决方案 »

  1.   

    CListBox::GetCurSel 
    获得当前选中的
      

  2.   

    用CListBox::GetSel 
    也可以CListBox::GetCurSel 
    不能用于multiple-selection
      

  3.   

    我发现CStdioFile中只有读写函数,没有删除函数。ReadString WriteString都不能删除.ini文件中的字符啊,大家指点一下。
      

  4.   

    读写ini文件不是有GetPrivateProfileString,WritePrivateProfileString这两个api函数的嘛,你可以调用他们的啊,呵呵至于你说的删除,好像cfile也没有封装专门的函数来删除指定的内容,要么,不嫌烦的话,比如你要中间的一段的话,那么把后面的那段写到前面,把中间的那段覆盖了,呵呵,有点麻烦啊
      

  5.   

    cfile怎么用后面的写到前面去吧,能给贴点代码看看吗