CListCtrl ON_WM_MEASUREITEM_REFLECT

CListCtrl ON_WM_MEASUREITEM_REFLECT

I have created CustomListCtrl with LVS_OWNERDRAWFIXED derived from MFC CListCtrl. I need to change the row height of ListCtrl during runtime. I have implemented this by handling ON_WM_MEASUREITEM_REFLECT notification. When i create control dynamically, this ON_WM_MEASUREITEM_REFLECT is not invoked. Note that this issue only occurs if the Dialog contains multiple CustomListCtrl. For the first ListCtrl it is invoked. It is not working even if below workaround is applied. Could any one help me in this issue. Thanks in advance.

Actually the issue was due to the duplication of control ID. MeasureItem reflection is based on control ID. If multiple controls has same id, it will send the reflected message to first control according to their tab order.

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright