• ### Announcements

#### Archived

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

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

## Recommended Posts

Mattman    336
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,

// 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 on other sites
jamessharpe    497
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 on other sites
alnite    3436
I think the height of a combo box includes the height of the dropdown list.

return 0;

##### Share on other sites
VbDestroyer    122
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.