From 597cb552cea8429106ab9e7e5b668ee55b13fefd Mon Sep 17 00:00:00 2001 From: Susan Farley Date: Mon, 14 Aug 2000 17:18:49 +0000 Subject: [PATCH] Update the edit box before rolling up the listbox, so the selection isn't lost. --- controls/combo.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index 805e3032484..7a24964aef6 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -1395,18 +1395,6 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) TRACE("[%04x]: lbox selection change [%04x]\n", CB_HWND(lphc), lphc->wState ); - /* do not roll up if selection is being tracked - * by arrowkeys in the dropdown listbox */ - - if( (lphc->dwStyle & CBS_SIMPLE) || - ((lphc->wState & CBF_DROPPED) && !(lphc->wState & CBF_NOROLLUP)) ) - { - CBRollUp( lphc, (HIWORD(wParam) == LBN_SELCHANGE), TRUE ); - } - else lphc->wState &= ~CBF_NOROLLUP; - - CB_NOTIFY( lphc, CBN_SELCHANGE ); - if( HIWORD(wParam) == LBN_SELCHANGE) { if( lphc->wState & CBF_EDIT ) @@ -1421,6 +1409,18 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd ) InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE); } + /* do not roll up if selection is being tracked + * by arrowkeys in the dropdown listbox */ + + if( (lphc->dwStyle & CBS_SIMPLE) || + ((lphc->wState & CBF_DROPPED) && !(lphc->wState & CBF_NOROLLUP)) ) + { + CBRollUp( lphc, (HIWORD(wParam) == LBN_SELCHANGE), TRUE ); + } + else lphc->wState &= ~CBF_NOROLLUP; + + CB_NOTIFY( lphc, CBN_SELCHANGE ); + /* fall through */ case LBN_SETFOCUS: