How to change height of owner drawn listbox dynamically in windows mobile?
I am trying to create owner drawn listbox on windows mobile 6.1 I have specified LBS_OWNERDRAWFIXED
style while creating listbox control. I am handling WM_MEASUREITEM
and WM_DRAWITEM
accordingly.
I want to change height of listbox item whenever its font changes (I change it using WM_SETFONT
after creating control). The problem is that WM_MEASUREITEM
开发者_StackOverflow社区 message gets sent only once. I need a way to generate WM_MEASUREITEM
message again so that I can set height of item to height of font. I have seen the article http://www.codeguru.com/Cpp/controls/listview/advanced/article.php/c1013/, but it uses MFC, while I am developing this control directly using WINAPI. Some articles mention that resizing the control generates WM_MEASUREITEM
message again. However, it is not getting generated in my case.
Please let me know is there any way to achieve this in windows mobile.
There is nothing particularly MFC in that code. OnSetFont is, simply, handling WM_SETFONT. MeasureItem is handling, in the MyListCtrl, the WM_MEASUREITEM sent to its parent.
As for generating a new WM_MEASUREITEM when you resize the window can't you just do a SendMessage when handling the WM_SIZE/WM_SIZING?
精彩评论