--- title: "How to: Use the Content-Scrolling Methods of ScrollViewer" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "IScrollInfo interface [WPF]" - "scrolling methods [WPF]" - "ScrollViewer control [WPF], scrolling methods" ms.assetid: 4708cc65-6510-45f8-82e6-30b0d3e30045 --- # How to: Use the Content-Scrolling Methods of ScrollViewer This example shows how to use the scrolling methods of the element. These methods provide incremental scrolling of content, either by line or by page, in a . ## Example The following example creates a named `sv1`, which hosts a child element. Because the is larger than the parent , scroll bars appear in order to enable scrolling. elements that represent the various scrolling methods are docked on the left in a separate . Each in the [!INCLUDE[TLA2#tla_xaml](../../../includes/tla2sharptla-xaml-md.md)] file calls a related custom method that controls scrolling behavior in . [!code-xaml[ScrollViewerMethods#1](~/samples/snippets/csharp/VS_Snippets_Wpf/ScrollViewerMethods/CSharp/Window1.xaml#1)] The following example uses the and methods. [!code-csharp[ScrollViewerMethods#2](~/samples/snippets/csharp/VS_Snippets_Wpf/ScrollViewerMethods/CSharp/Window1.xaml.cs#2)] [!code-vb[ScrollViewerMethods#2](~/samples/snippets/visualbasic/VS_Snippets_Wpf/ScrollViewerMethods/VisualBasic/Window1.xaml.vb#2)] ## See also - -