clistbox

CListBox's Item size changed when changing the size of the list box even if I specify the size in MeasureItem() method?

I used a class which derives from CListBox, and create it with following style:WS_CHILD|WS_VISIBLE |LBS_OWNERDRAWFIXED | WS_VSCROLL | WS_HSCROLL I expect the ListBox's item to be have a fixed size, not affected by the size of the list box. So I override the MeasureItem() method, in which I specify the item's size like below: void CMyLi...

Listbox width size dependent of text length

My application has a window with a ListBox inside which is filled with text that changes over time, therefore Listbox entries can have several length. I'd like to make the window and the listbox width to change dynamically dependent on the listbox entries length (in number of characters). As an example, if my listbox has several entri...

Simple way to set font type in MFC CListBox

I have always used the default ListBox control with the property of OWNER DRAW set to NO. But now I need to set a fixed sized mono font since my formatted strings are not aligning up even though I have the default right aligned and necessary width padding set beyond the actual size of the digit string. My problem is I don't have a clu...