Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

NorthWoodsman

Annoying MFC CComboBox Issue

This topic is 5876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my program I have a dialog which has a Combo Box set to Drop List. The items are added progmatically, but when I go to open the Combo Box, it opens with a height of 1 pixel. I''ve tried to use some of the MFC CComboBox::Set.. Functions just to see if it does anything, but none of them have any effect. Note that I am developing on Pocket PC, but I''ve had this problem on x86 too.

Share this post


Link to post
Share on other sites
Advertisement
I had a very similar thing happen to me. In the resource editor change the style of the dropdown so that it''s a multiselect list box. Compile and run your code.
Magically any items you Add() to the list box will appear, now set the style of the box back to a dropdown. Compile and run your code, for me this magically mad the dropdown start working.
It''s worth a shot.

Share this post


Link to post
Share on other sites
The resource editor is a bit odd about setting the size of the drop-down part. I think you need to click on the down arrow part of the combo box for the resource editor to show you the size of the drop-down part. When you do that, just drag that thing down a ways.

Value of good ideas: 10 cents per dozen.
Implementation of the good ideas: Priceless.

Proxima Rebellion - A 3D action sim with a hint of strategy

Share this post


Link to post
Share on other sites
Dunno if it''s what you''re looking for, but try in the resoure editor clicking on the down arrow then resizing. Maybe this is something you''ve already done, but took me a bloody long time to find out about this.

Share this post


Link to post
Share on other sites
Suppose you want the dropdown list to be 100 px high, try this:

CRect r;
m_wndCombo.GetWindowRect(r);
m_wndCombo.SetWindowPos(NULL, 0, 0, r.Width(), 100,
SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);



"Oh no, not again" - Agrajag

Share this post


Link to post
Share on other sites
I don''t want to meet the guy who designed this drop-arrow-click-to-resize-combo stuff. He sure has been giving a lot of headaches to the developer community, including me.

______________________________
Oooh, you found the horadric cube!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''m extremely experianced with MFC and I concur with BS-er as the esiest approach.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!