通过一个按钮删除我在ListCtrl中选的一项

来源:互联网 发布:戴眼镜的网络歌手 编辑:程序博客网 时间:2024/05/16 18:20

我想通过一个按钮删除我在ListCtrl中选的一项  
   
  用了如下的代码:  
   
  void   CRemindDlg::OnDelete()    
  {  
     //   TODO:   Add   your   control   notification   handler   code   here  
     CString   strTime;  
     strTime=m_Remind.GetItemText(0,0);  
     if(strTime.IsEmpty())   MessageBox("没有可以删除的项!");  
     else   if(m_Remind.GetSelectionMark()==-1)   MessageBox("请选择你要删除的项!");  
     else    
     {  
  m_Remind.DeleteItem(m_Remind.GetSelectionMark());  
     }  
  }