- wxControl::DoSetSize(x, y, width, height, sizeFlags);
+
+ // the height which we must pass to Windows should be the total height of
+ // the control including the drop down list while the height given to us
+ // is, of course, just the height of the permanently visible part of it so
+ // add the drop down height to it
+
+ // don't make the drop down list too tall, arbitrarily limit it to 30
+ // items max and also don't make it too small if it's currently empty
+ size_t nItems = GetCount();
+ if ( !nItems )
+ nItems = 9;
+ else if ( nItems > 30 )
+ nItems = 30;
+
+ const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0);
+ const int heightWithItems = height + hItem*nItems;
+
+
+ // do resize the native control
+ wxControl::DoSetSize(x, y, width, heightWithItems, sizeFlags);
+