X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0d7f75df793b32c7ff6e28c83792ab3f8eafe46e..c616c2e834192db06bbef18b9404824f563e335f:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e7129e32d5..08567e34a4 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -938,11 +938,13 @@ void wxWindowMSW::SetScrollbar(int orient, HWND hWnd = GetHwnd(); if ( hWnd ) { + // We have to set the variables here to make them valid in events + // triggered by ::SetScrollInfo() + *(orient == wxHORIZONTAL ? &m_xThumbSize : &m_yThumbSize) = pageSize; + ::SetScrollInfo(hWnd, orient == wxHORIZONTAL ? SB_HORZ : SB_VERT, &info, refresh); } - - *(orient == wxHORIZONTAL ? &m_xThumbSize : &m_yThumbSize) = pageSize; } void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect)