Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/how-to-handle-the-scrollchanged-event.md
T
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

1.6 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Handle the ScrollChanged Event 03/30/2017
csharp
vb
ScrollViewer control [WPF], raising ScrollChanged events
ScrollChanged events [WPF]
42c695d8-ee28-49d4-80fd-fc71e9be7f29

How to: Handle the ScrollChanged Event

Example

This example shows how to handle the xref:System.Windows.Controls.ScrollViewer.ScrollChanged event of a xref:System.Windows.Controls.ScrollViewer.

A xref:System.Windows.Documents.FlowDocument element with xref:System.Windows.Documents.Paragraph parts is defined in XAML. When the xref:System.Windows.Controls.ScrollViewer.ScrollChanged event occurs due to user interaction, a handler is invoked, and text is written to a xref:System.Windows.Controls.TextBlock indicating that the event has occurred.

[!code-xamlscrollchangedeventargsLayout#1]
[!code-xamlscrollchangedeventargsLayout#2]

[!code-csharpscrollchangedeventargsLayout#3] [!code-vbscrollchangedeventargsLayout#3]

See also