--- title: "How to: Scroll Content by Using the IScrollInfo Interface" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "ScrollViewer control [WPF], scrolling content" - "scrolling content [WPF]" - "IScrollInfo interface [WPF]" ms.assetid: d8700bef-a3f8-4c12-9de2-fc3b79f32cd3 --- # How to: Scroll Content by Using the IScrollInfo Interface This example shows how to scroll content by using the interface. ## Example The following example demonstrates the features of the interface. The example creates a element in [!INCLUDE[TLA#tla_xaml](../../../includes/tlasharptla-xaml-md.md)] that is nested in a parent . The child elements of the can be scrolled logically by using the methods defined by the interface and cast to the instance of (`sp1`) in code. [!code-xaml[IScrollInfoMethods#2](~/samples/snippets/csharp/VS_Snippets_Wpf/IScrollInfoMethods/CSharp/Window1.xaml#2)] Each in the [!INCLUDE[TLA2#tla_xaml](../../../includes/tla2sharptla-xaml-md.md)] file triggers an associated custom method that controls scrolling behavior in . The following example shows how to use the and methods; it also generically shows how to use all the positioning methods that the class defines. [!code-csharp[IScrollInfoMethods#3](~/samples/snippets/csharp/VS_Snippets_Wpf/IScrollInfoMethods/CSharp/Window1.xaml.cs#3)] [!code-vb[IScrollInfoMethods#3](~/samples/snippets/visualbasic/VS_Snippets_Wpf/IScrollInfoMethods/VisualBasic/Window1.xaml.vb#3)] ## See also - - - - [ScrollViewer Overview](scrollviewer-overview.md) - [How-to Topics](scrollviewer-how-to-topics.md) - [Panels Overview](panels-overview.md)