]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/choice.cpp
Fix choice of tree item icon for the selected state in wxMSW.
[wxWidgets.git] / src / msw / choice.cpp
index 03d3b3fb50fb1912af0de865e57f7abc7002850d..3fd0fefc5a338c79101d8e712674737adb03e1ed 100644 (file)
@@ -544,7 +544,10 @@ void wxChoice::DoSetSize(int x, int y,
     const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0);
     int heightWithItems = 0;
     if (!HasFlag(wxCB_SIMPLE))
-        heightWithItems = height + hItem*nItems;
+        // The extra item (" + 1") is required to prevent a vertical
+        // scrollbar from appearing with comctl32.dll versions earlier
+        // than 6.0 (such as found in Win2k).
+        heightWithItems = height + hItem*(nItems + 1);
     else
         heightWithItems = SetHeightSimpleComboBox(nItems);