Archived

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

Mattman

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

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.

James

Share this post


Link to post
Share on other sites
Hello-
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