470,619 Members | 2,033 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

How can I change the list height for a ComboBox?

I am making a class dervied from ComboBox. The height of the items in the list will be changed by the program. I've gotten this to work with OnMeasureItem, but there is a large space left behind. For example, if their originally was 10 items each with a height of 20 and I changed the height of all of them to 10, then their would be a space of 100 that is blank and unselectable. I am using the following properties

mycombobox->DrawMode = DrawMode::OwnerDrawVariable
mycombobox->DropDownStyle = ComboBoxStyle::DropDownList

I'd like a function like the following

void MyComboBox::FixComboBoxListHeight()
int idx
int total_height

total_height = 0
for(idx=0; idx < Items->Count; idx++)
total_height += GetItemHeight(idx)
SetListHeight(total_height); /* I can't figure out how to do this. *
Any ideas

Nov 17 '05 #1
0 1422

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Austin | last post: by
2 posts views Thread by Thomas Wang | last post: by
4 posts views Thread by Maria | last post: by
12 posts views Thread by Sam | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.