我在对话框上拉了个listbox控件,但不知道怎么改变它的排序方法。在msdn上好像只有在create的时候可以设定,我改怎么办?
解决方案 »
- 我太菜了,我发现没有MSDN 我连IOCP都写不出来?
- 为什么GetDocument的实现函数里面要去IsKindOf(RUNTIME_CLASS)判断一下类型?
- 屏幕监控的方案?谢谢了!
- CListCtrl 问题,带CHECKBOX的,怎么让CHECKBOX默认选中???????????????????/
- 如何在程序启动后依次弹出一系列对话诓,当一个按下一个对话框后出现另一个对话框?谢谢
- 如何隐藏程序
- 请看~~~中间层是odbc api,前端开发工具除了vc++,还有其他的吗?哪个好呢?
- CComboBox问题
- vc中如何读取文本文件,一航一航的读取,(来者有分)
- ATL新建Service为什么什么操作也不做,全部编译器生成的代码直接注册服务报错。。折磨死我了
- 诸位做过在 vc的一个程序下嵌入 outlook控件,以便自己的程序方便的实现mail处理的功能吗?
- 最初级的问题,使用DOM读XML文件,刚编译就出错,是缺了头文件吗?
If you create an owner-draw list box with the LBS_SORT style, you must override this member function to assist the framework in sorting new items added to the list box.
Example// CMyListBox is my owner-drawn list box derived from CListBox. This
// example compares two items using strcmp to sort items in reverse
// alphabetical order. The list box control was created with the
// following code:
// pmyListBox->Create(
// WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL|
// LBS_SORT|LBS_MULTIPLESEL|LBS_OWNERDRAWVARIABLE,
// myRect, pParentWnd, 1);
//
int CMyListBox::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct)
{
ASSERT(lpCompareItemStruct->CtlType == ODT_LISTBOX);
LPCTSTR lpszText1 = (LPCTSTR) lpCompareItemStruct->itemData1;
ASSERT(lpszText1 != NULL);
LPCTSTR lpszText2 = (LPCTSTR) lpCompareItemStruct->itemData2;
ASSERT(lpszText2 != NULL); return strcmp(lpszText2, lpszText1);
}