CListBox快速清空

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kulala082/article/details/78687822

方法一:

while(pmyListBox->GetCount()) 
    pmyListBox->DeleteString( 0 ); 

方法二:

int nListCount=pMyListBox->GetCount(); 
for (int i=0;i < nListCount;i++) 
{ 
    pmyListBox->DeleteString(0);//循环次数等于总个数,每次都删除第一个,一样没有清空 
} 

方法三:

CListBox *box=(CListBox *)GetDlgItem(IDC_LIST_INFO);
box->ResetContent(); 


猜你喜欢

转载自blog.csdn.net/kulala082/article/details/78687822