From 50f8e4b17134001256155a604a32e80a5e0e4ee2 Mon Sep 17 00:00:00 2001 From: Pierre Mageau Date: Sat, 23 Oct 1999 23:57:42 +0000 Subject: [PATCH] Update the item width upon a new column in the header control. --- dlls/comctl32/listview.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index ca0eef0217a..5c945f5b50b 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -2498,6 +2498,9 @@ static LRESULT LISTVIEW_DeleteColumn(HWND hwnd, INT nColumn) { bResult = LISTVIEW_RemoveColumn(infoPtr->hdpaItems, nColumn); + /* Need to reset the item width when deleting a column */ + infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); + /* reset scroll parameters */ if (uView == LVS_REPORT) { @@ -4707,6 +4710,9 @@ static LRESULT LISTVIEW_InsertColumnA(HWND hwnd, INT nColumn, /* insert item in header control */ nNewColumn = SendMessageA(infoPtr->hwndHeader, HDM_INSERTITEMA, (WPARAM)nColumn, (LPARAM)&hdi); + + /* Need to reset the item width when inserting a new column */ + infoPtr->nItemWidth = LISTVIEW_GetItemWidth(hwnd); LISTVIEW_UpdateScroll(hwnd); InvalidateRect(hwnd, NULL, FALSE);