wxScrolledWindow

From WxWiki
Jump to: navigation, search
Official Classes SmallBlocks.png Archive Containers Controls Data Structures Database Date & Time Debug Device Contexts Dialogs Document & Views Drag & Drop Events Filesystem Frames Graphics Grid Cell Help HTML Logging Miscellaneous Networking Printing Sizers Streams Threading Windows

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.

See Also