From a647b6da729097d2ec4d8dba738d53dfc1df9973 Mon Sep 17 00:00:00 2001 From: Catalin Date: Thu, 18 May 2017 23:39:01 +0200 Subject: [PATCH] Fix switching to report view using SetWindowStyleFlag() Closes #17059. Closes https://github.com/wxWidgets/wxWidgets/pull/425. --- src/msw/listctrl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index fff248cd60..a263a8e152 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -502,10 +502,17 @@ void wxListCtrl::SetWindowStyleFlag(long flag) { if ( flag != m_windowStyle ) { + const bool wasInReportView = InReportView(); + wxListCtrlBase::SetWindowStyleFlag(flag); UpdateStyle(); + // if we switched to the report view, set the extended styles for + // it too + if ( !wasInReportView && InReportView() ) + MSWSetExListStyles(); + Refresh(); } }