X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1df09276caf8575eed4e9bf2689c69903a749a9..a06066343d670807825adcafebfa4fb8cfff5521:/src/msw/combobox.cpp diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index d250452a79..f00c1297c9 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -97,7 +97,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, int height = size.y; long msStyle = WS_CHILD | WS_TABSTOP | WS_VISIBLE | - CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT; + WS_VSCROLL | WS_HSCROLL | CBS_AUTOHSCROLL | CBS_NOINTEGRALHEIGHT; if (m_windowStyle & wxCB_READONLY) msStyle |= CBS_DROPDOWNLIST; @@ -332,9 +332,14 @@ void wxComboBox::DoMoveWindow(int x, int y, int width, int height) int cx, cy; wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); + // what should the height of the drop down list be? we choose 10 items by + // default and also 10 items max (if we always use n, the list will never + // have vertical scrollbar) int n = GetCount(); if ( !n ) n = 10; + else if ( n > 10 ) + n = 10; height = n * EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);