From 66c1accb6fcd8b26e5638dbe4a6afd0ff34b71fb Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 18 Mar 2004 04:00:08 +0000 Subject: [PATCH] Invalidate the focused item when scrolling horizontally so that it repaints correctly. --- controls/listbox.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controls/listbox.c b/controls/listbox.c index 5c5cca44603..5916a179f0e 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -1210,8 +1210,14 @@ static void LISTBOX_SetHorizontalPos( HWND hwnd, LB_DESCR *descr, INT pos ) descr->horz_pos = pos; LISTBOX_UpdateScroll( hwnd, descr ); if (abs(diff) < descr->width) + { + RECT rect; + /* Invalidate the focused item so it will be repainted correctly */ + if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1) + InvalidateRect( hwnd, &rect, TRUE ); ScrollWindowEx( hwnd, diff, 0, NULL, NULL, 0, NULL, SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN ); + } else InvalidateRect( hwnd, NULL, TRUE ); }