man*_*ena 2 c++ windows sorting mfc
伪代码:
CListBox listBox;
CString[10] str; //consider it is initialised with valid string
for(int i=0; i<10 ; i++)
listBox.AddString(str[i]);
Run Code Online (Sandbox Code Playgroud)
每当我CListBox使用该函数向对象添加条目/字符串时AddString(),MFC会CListBox在添加每个字符串时自动对条目进行排序.
如何明确告诉MFC保持项目的添加顺序(不进行排序).
PS:我不想使用这个功能InsertString().
谢谢!
在Properties标签中有一个Sort属性.将它的值设置为False.
编辑:
正如@The Forest And The Trees已经提到的,你可以从代码中获得相同的结果:
listBox.ModifyStyle(LBS_SORT);
| 归档时间: |
|
| 查看次数: |
3321 次 |
| 最近记录: |