--- title: "How to: Handle the ScrollChanged Event" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "ScrollViewer control [WPF], raising ScrollChanged events" - "ScrollChanged events [WPF]" ms.assetid: 42c695d8-ee28-49d4-80fd-fc71e9be7f29 --- # How to: Handle the ScrollChanged Event ## Example This example shows how to handle the event of a . A element with parts is defined in [!INCLUDE[TLA2#tla_xaml](../../../includes/tla2sharptla-xaml-md.md)]. When the event occurs due to user interaction, a handler is invoked, and text is written to a indicating that the event has occurred. [!code-xaml[scrollchangedeventargsLayout#1](~/samples/snippets/csharp/VS_Snippets_Wpf/scrollchangedeventargsLayout/CSharp/Window1.xaml#1)] [!code-xaml[scrollchangedeventargsLayout#2](~/samples/snippets/csharp/VS_Snippets_Wpf/scrollchangedeventargsLayout/CSharp/Window1.xaml#2)] [!code-csharp[scrollchangedeventargsLayout#3](~/samples/snippets/csharp/VS_Snippets_Wpf/scrollchangedeventargsLayout/CSharp/Window1.xaml.cs#3)] [!code-vb[scrollchangedeventargsLayout#3](~/samples/snippets/visualbasic/VS_Snippets_Wpf/scrollchangedeventargsLayout/VisualBasic/Window1.xaml.vb#3)] ## See also - - - -