X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7561aacd5e3bcd5f98f4cdadcec5e94d1550b369..8e0e4b1b644fd58825f7c4c80775d9507020ffac:/src/msw/listbox.cpp?ds=sidebyside diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 147e73c917..e466ae97ee 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -663,7 +663,10 @@ wxSize wxListBox::DoGetBestSize() const wListbox += 3*cx; - int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)*(wxMax(m_noItems, 7)); + // don't make the listbox too tall (limit height to 10 items) but don't + // make it too small neither + int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)* + wxMin(wxMax(m_noItems, 3), 10); return wxSize(wListbox, hListbox); }