CListBox用 owner draw属性,重载 drawitem(),
CListBox附属于 Dialog dlg,
first , dlg.domodal.   ok
second, dlg.domodal,   not display , not drawitem() list box.how to deal with this? help me, thank

解决方案 »

  1.   

    second那一段是什么意思?
    反正只要对话框显示,CListBox需要重画时,都会调用DrawItem函数。因为CListBox的显示全靠它了。
      

  2.   

    多次调用 dlg.domodal(),第二次开始子的CListBox显示没有出现。
      

  3.   

    要不把程序发来看看吧。[email protected]
      

  4.   

    你可以响应绘制消息, 
    在控件的 OnDraw 函数内绘制控件即可.
      

  5.   

    增加virtual BOOL PreCreateWindow()函数,即可实现drawitem函数
      

  6.   

    我想 问题主要是 CListBox附属于 Dialog A, Dialog 多次调用 Domodal的时候,除了第一次ClistBox成功绘制数据(InsertString),后面再次显示CListBox时,DrawItem函数不会自动调用。这样CListBox的显示为空,与实际的数据不符,前面(InsertString)的数据没有正常被刷新。所以再次显示CListBox时,只能 deleteallitem,然后再insert string 一遍。对吗?