From 02c8973a575d14a66898533293ab58dd30447616 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. See #17158. --- 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 5e27d051cb..0ad159248c 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -623,7 +623,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; } // ----------------------------------------------------------------------------