From acb308af673472a380cd4c9ebd2aa26dbd0cc635 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Wed, 28 Aug 2002 00:53:23 +0000 Subject: [PATCH] If we have no dropdown height give ourselves a minimum height of 5 items or max items (whichever is less). --- controls/combo.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index c576c300bf..d9a437b2dd 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -1195,12 +1195,22 @@ static void CBDropDown( LPHEADCOMBO lphc ) if (nItems > 0) { int nHeight; + int nIHeight; - nHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0); - nHeight *= nItems; + nIHeight = (int)SendMessageW(lphc->hWndLBox, LB_GETITEMHEIGHT, 0, 0); + + nHeight = nIHeight*nItems; if (nHeight < nDroppedHeight - COMBO_YBORDERSIZE()) nDroppedHeight = nHeight + COMBO_YBORDERSIZE(); + + if (nDroppedHeight < nIHeight) + { + if (nItems < 5) + nDroppedHeight = nHeight; + else + nDroppedHeight = 5*nIHeight; + } } /*If height of dropped rectangle gets beyond a screen size it should go up, otherwise down.*/ -- 2.32.0.93.g670b81a890