这个问题是关于MFC中的ComboBox控件.
以前想删除控件中的项目,都是这个做的:
int temp = m_clComBox.GetCount();
for(int nIndex = 0;nIndex < temp;nIndex++)
{
m_clComBox.DeleteString(0);
}
今天才在网上看到原来可以这样做:
clComBox.ResetContent();
本文介绍MFC中ComboBox控件的两种清空方法:使用循环逐个删除项目和直接调用ResetContent()方法。后者更为简洁高效。
这个问题是关于MFC中的ComboBox控件.
以前想删除控件中的项目,都是这个做的:
int temp = m_clComBox.GetCount();
for(int nIndex = 0;nIndex < temp;nIndex++)
{
m_clComBox.DeleteString(0);
}
今天才在网上看到原来可以这样做:
clComBox.ResetContent();

被折叠的 条评论
为什么被折叠?