You need to override OnMeasureItem()
-SM
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have created my own list box with the base class of CListBox. when I use it in the Dialog box it works fine.
but when I try to create dynamic at runtime it gives an error.
here is my code for it
m_LstList= new x_ListBox;
m_LstList->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_HSCROLL | WS_VSCROLL |
LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS, rect, m_hWnd, IDC_X_LIST);
am I doing anything wrong?
or there is any extra setting I have to make inside x_ListBox class
class x_ListBox : public CListBox
{
public:
x_ListBox();
virtual ~x_ListBox();
LIST_BOX_TYPE m_ListBoxType;
// my functions for custom draw
protected:
afx_msg void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
DECLARE_MESSAGE_MAP()
};
You need to override OnMeasureItem()
-SM
hi dear,
is it possible to refer any sample code for that? that would be great if I can see any reference.
Thanks a lot.
BTW. that is Manage C++. is that same as native? I've never tried it.
I am really thankful for your support and the time you spend on my problem. I will try to understand and try to follow it.
thank you very much.