vendredi 1 juillet 2016

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 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.


Aucun commentaire:

Enregistrer un commentaire