+ // 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
+ if ( height != -1 )
+ {
+ // don't make the drop down list too tall, arbitrarily limit it to 40
+ // items max and also don't leave it empty
+ size_t nItems = GetCount();
+ if ( !nItems )
+ nItems = 9;
+ else if ( nItems > 39 )
+ nItems = 39;
+
+ // add space for the drop down list
+ const int hItem = SendMessage(GetHwnd(), CB_GETITEMHEIGHT, 0, 0);
+ height += hItem*(nItems + 1);
+ }
+
+ wxControl::DoSetSize(x, y, width, height, sizeFlags);
+
+ // if the height specified for the visible part of the control is
+ // different from the current one, we need to change it separately
+ // as it is not affected by normal WM_SETSIZE
+ if ( height != -1 )
+ {
+ const int hVisibleCurrent = GetVisibleHeight();
+ if ( hVisibleCurrent != heightOrig )
+ {
+ SendMessage(GetHwnd(), CB_SETITEMHEIGHT, (WPARAM)-1, heightOrig);
+ }
+ }