MFC之ListControl选中行删除

if (m_list.GetSelectedCount() > 0) {

    POSITION pos=    m_list.GetFirstSelectedItemPosition();

    while (pos)
    {
        int nSelected = m_list.GetNextSelectedItem(pos); //获取选中行的索引
        m_list.DeleteItem(nSelected); //根据索引删除
        pos = m_list.GetFirstSelectedItemPosition();
    }

    }

 

你可能感兴趣的:(MFC之ListControl选中行删除)