用CreateWindowEx创造出LISTBOX之后,是否用SENDMESSAGE对LISTBOX进行添加,删除等等的操作,如果是的话这些消息是什么,如不是那又是怎样控制LISTBOX呢

解决方案 »

  1.   

    ListBox 控件显示项目列表,从其中可以选择一项或多项。如果项目总数超过了可显示的项目数,就自动在 ListBox 控件上添加滚动条。
    如果未选定项目,则 ListIndex 属性值是 -1。列表的第一项是 ListIndex 0,ListCount 属性值总是比最大的 ListIndex 值大 1
    使用 AddItem 或者 RemoveItem 方法可以添加或者删除 ListBox 控件中的项目。对 List、ListCount 和 ListIndex 属性进行设置就可以访问 ListBox 中的项目。也可以在设计时使用 List 属性在列表中增加项目。
      

  2.   

    消息:
    LB_ADDSTRING 
    LB_DELETESTRING
    等消息,具体请参考msdn
      

  3.   

    还请问LBS_OWNERDRAWVARIABLE和LBS_OWNERDRAWFIXED这两个自绘消息有什么不同啊
      

  4.   

    另外在MFC里面把LISTBOX改为自绘STYLE之后提示要重载CompareItem这个函数,请问这个函数是什么用的
      

  5.   

    CListBox::CompareItem
    This method is called by the framework to determine the relative position of a new item in a sorted owner-draw list box. By default, this method does nothing. If you create an owner-draw list box with the LBS_SORT style, you must override this method to assist the framework in sorting new items added to the list box.
      

  6.   

    强烈建议看一下Windows程序设计
    那里面有非常详细的介绍,不只是LISTBOX