Jump to content
  • Advertisement


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


The dropdown lists on my ComboBoxes won't display!!!

This topic is 5622 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

For some reason, I can't seem to make the display region of my ComboBoxes display. I have the following code to create a ComboBox and add contents:
hWndTemp = CreateWindow("combobox", "",
                              WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
                              CBS_SORT | CBS_DROPDOWN | CBS_HASSTRINGS |
                              CBS_OEMCONVERT | CBS_OWNERDRAWFIXED,
                              72, 16, 128, 16,
                              hWnd, (HMENU) ID_DRIVE, hInst, 0);

// Set ComboBox item heights.
SendMessage(hWndTemp, CB_SETITEMHEIGHT, (WPARAM) 0, (LPARAM) (long) 128);
SendMessage(hWndTemp, CB_SETITEMHEIGHT, (WPARAM) -1, (LPARAM) (long) 16);

// Clear contents, add directory listing, and set currently selected item.
SendMessage(hWndTemp, CB_RESETCONTENT, (WPARAM) 0, (LPARAM) 0);
SendMessage(hWndTemp, CB_DIR, (WPARAM) (DDL_DRIVES | DDL_READWRITE), (LPARAM) "*.*");
SendMessage(hWndTemp, CB_SETCURSEL, (WPARAM) 0, (LPARAM) 0);
The image below illustrates what happens when I click (left side is before click, right side is after clicking, when the dropdown list is supposed to appear).
[edited by - Mattman on January 28, 2003 3:50:04 PM]

Share this post

Link to post
Share on other sites
Isn''t the height that you set the combobox to the height when it is open? Try increasing the height setting and see if that helps. It''s been a while since I played around with windows controls.


Share this post

Link to post
Share on other sites
You are correct, the height does influence the size when opening. Another thing is that if it is too close to the bottom it has a tendency of not showing all the options because it will go off the form.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!