From fd95ab561573571338f38af4f1fc4f90ef1d1283 Mon Sep 17 00:00:00 2001 From: Andreas Falkenhahn Date: Sun, 20 Sep 2015 13:35:01 +0200 Subject: [PATCH] Refresh wxListCtrl with wxLC_HRULES in SetColumnWidth() in wxMSW This is necessary to avoid corrupted rules display after changing the column width. Closes #17158. (cherry picked from commit 02c8973a575d14a66898533293ab58dd30447616) --- src/msw/listctrl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 0772db7a25..008146c9f1 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -620,7 +620,15 @@ bool wxListCtrl::SetColumnWidth(int col, int width) else if ( width == wxLIST_AUTOSIZE_USEHEADER) width = LVSCW_AUTOSIZE_USEHEADER; - return ListView_SetColumnWidth(GetHwnd(), col, width) != 0; + if ( !ListView_SetColumnWidth(GetHwnd(), col, width) ) + return false; + + // Failure to explicitly refresh the control with horizontal rules results + // in corrupted rules display. + if ( HasFlag(wxLC_HRULES) ) + Refresh(); + + return true; } // ----------------------------------------------------------------------------