Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-control-a-storyboard-after-it-starts.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

3.0 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Control a Storyboard After It Starts 03/30/2017
csharp
vb
Storyboards [WPF], controlling after start
040f13f0-69f9-4ab5-be2b-079f4f80c7c0

How to: Control a Storyboard After It Starts

This example shows how to use code to control a xref:System.Windows.Media.Animation.Storyboard after it has started. To control a storyboard in XAML, use xref:System.Windows.Trigger and xref:System.Windows.TriggerAction objects; for an example, see Use Event Triggers to Control a Storyboard After It Starts.

To start a storyboard, you use its xref:System.Windows.Media.Animation.Storyboard.Begin%2A method, which distributes the storyboard's animations to the properties they animate and starts the storyboard.

To make a storyboard controllable, you use the xref:System.Windows.Media.Animation.Storyboard.Begin%2A method and specify true as the second parameter. You can then use the storyboard's interactive methods to pause, resume, seek, stop, speed up, or slow down the storyboard, or advance it to its fill period. The following is a list of the storyboard's interactive methods:

In the following example, several storyboard methods are used to interactively control a storyboard.

Note

To see an example of controlling a storyboard using triggers with XAML, see Use Event Triggers to Control a Storyboard After It Starts.

Example

[!code-csharptimingbehaviors_procedural_snip#ControlStoryboardExampleUsingWholePage] [!code-vbtimingbehaviors_procedural_snip#ControlStoryboardExampleUsingWholePage]

See also