Adding a Scrollbar to the WrapPanel

azamsharp picture azamsharp · Dec 11, 2008 · Viewed 14k times · Source

How can I add a scrollbar to the wrappanel control in WPF. Some of my controls are cutting off width wise due to the no scrollbar.

Answer

Stephen Wrighton picture Stephen Wrighton · Dec 11, 2008

The ScrollViewer will be helpful for you in this situation. Otherwise, you'll need to use the ScrollBar control and manually control what's visible.

Usage example for the scrollviewer:

<DockPanel>
   <ScrollViewer VerticalScrollBarVisibility="Auto">
       <StackPanel />
   </ScrollViewer >
</DockPanel>