From d292234835380747c69a0f47c1dc7c29b837cf6e Mon Sep 17 00:00:00 2001 From: Gerard Patel <g.patel@wanadoo.fr> Date: Sun, 25 Jun 2000 12:47:59 +0000 Subject: [PATCH] Set the minimum dropped height to the combo list height if any in CBDropDown. --- controls/combo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controls/combo.c b/controls/combo.c index 902643f97bb..05ad7c922b1 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -1106,7 +1106,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) */ static void CBDropDown( LPHEADCOMBO lphc ) { - RECT rect; + RECT rect,r; int nItems = 0; int nDroppedHeight; @@ -1148,6 +1148,10 @@ static void CBDropDown( LPHEADCOMBO lphc ) /* And Remove any extra space (Best Fit) */ nDroppedHeight = lphc->droppedRect.bottom - lphc->droppedRect.top; + /* if listbox length has been set directly by its handle */ + GetWindowRect(lphc->hWndLBox, &r); + if (nDroppedHeight < r.bottom - r.top) + nDroppedHeight = r.bottom - r.top; nItems = (int)SendMessageA (lphc->hWndLBox, LB_GETCOUNT, 0, 0); if (nItems > 0) -- GitLab