The wxScrolledWindow class manages scrolling for its client area, transforming the coordinates according to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.
Force a wxScrolledWindow to recalculate the VirtualSize / Scrollbars
Add following two lines to the derived OnSize event.
wxSize size = m_targetWindow->GetBestVirtualSize();
m_win->SetVirtualSize( size );
and the virtual area and the scrollbars will be recalculated.
Trouble with The most automatic and newest way
Don't forget to call SetScrollRate. If you want to add components dynamically sizer->FitInside(this) makes the scroll bars appear without resizing the panel.