diff --git a/include/wx/msw/statbox.h b/include/wx/msw/statbox.h index 2280cb17d9..03b1c72993 100644 --- a/include/wx/msw/statbox.h +++ b/include/wx/msw/statbox.h @@ -97,6 +97,8 @@ protected: void OnPaint(wxPaintEvent& event); + virtual void MSWBeforeDPIChangedEvent(const wxDPIChangedEvent& event) override; + private: void PositionLabelWindow(); diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 161d438f39..47c2991408 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -366,6 +366,11 @@ WXLRESULT wxStaticBox::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPar return wxControl::MSWWindowProc(nMsg, wParam, lParam); } +void wxStaticBox::MSWBeforeDPIChangedEvent(const wxDPIChangedEvent& WXUNUSED(event)) +{ + PositionLabelWindow(); +} + // ---------------------------------------------------------------------------- // static box drawing // ----------------------------------------------------------------------------