Sign in to follow this  
santonel

WIN32 API ComboBox Question

Recommended Posts

santonel    106
Hey, I've created a combobox control programmatically using CreateWindowEx() and add to it by sending CB_ADDSTRING messages. The problem is that it doesnt pop down when you push the arrow button. I've done some searching on this and I guess it's because you have to set the dropdown height which is either very small or zero by default. In the resourcae editor you would simply resize it but how would you do it in code. Ive been looking through MSDN and found a CB_SETDROPDOWNWIDTH message but not one for height. What message do I send to set the drop down height?

Share this post


Link to post
Share on other sites
Endurion    5408
You set the combo dropdown list height by the normal window size. In CreateWindow pass the height you want of the combo plus the opened listbox. The combo's edit will always have a default height, the rest is used to determine the height of the listbox.

Share this post


Link to post
Share on other sites
santonel    106
Quote:
Original post by Endurion
You set the combo dropdown list height by the normal window size. In CreateWindow pass the height you want of the combo plus the opened listbox. The combo's edit will always have a default height, the rest is used to determine the height of the listbox.


It worked! Thanx!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this