随笔 - 14  文章 - 1 评论 - 13 
<2008年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用链接

留言簿(1)

随笔分类

随笔档案

相册

搜索

  •  

最新评论

阅读排行榜

评论排行榜

重绘listbox时遇到的问题,开始在OnMeasureItem里做的操作,结果挂了。。。在MeasureItem里OK。
CSDN上达人的解释。。。清楚了。

OnMeasureItem will be called only if the control's class is created at run time, 
or it is created with the LBS_OWNERDRAWVARIABLE or CBS_OWNERDRAWVARIABLE style. 
If the control is created by the dialog editor, OnMeasureItem will not be called. 
This is because the WM_MEASUREITEM message is sent early in the creation process of the control. 
If you subclass by using DDX_Control, SubclassDlgItem, or SubclassWindow, 
the subclassing usually occurs after the creation process. 
Therefore, there is no way to handle the WM_MEASUREITEM message in the 
control's OnChildNotify function, which is the mechanism MFC uses to implement 
ON_WM_MEASUREITEM_REFLECT.

另一个的解释是OnMeasureItem是响应子控件的WM_MEASUREITEM消息的,MeasureItem是响应反射的自己发送的WM_MEASUREITEM消息的。


上面貌似是MSDN上的...
posted on 2008-05-27 23:59 田园的拾荒者 阅读(5259) 评论(1)  编辑 收藏 引用 所属分类: C/C++

FeedBack:
# re: OnMeasureItem与MeasureItem的区别 2008-05-28 16:18 盛大推广员
以后仔细看看。呵呵  回复  更多评论
  
只有注册用户登录后才能发表评论。