diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 1835296b47..222c787bc9 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -739,6 +739,11 @@ wxSize wxSpinCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const wxTextCtrl text; TempHWNDSetter set(&text, m_hwndBuddy); + // It's unnecessary to actually change the font used by the buddy control, + // but we do need to ensure that the helper wxTextCtrl wxFont matches what + // it is used as GetSizeFromTextSize() uses the current font. + text.wxWindowBase::SetFont(GetFont()); + // Increase the width to accommodate the button, which should fit inside // the text control while taking account of the overlap. return text.GetSizeFromTextSize(xlen + sizeBtn.x - GetOverlap(), ylen);