Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-control-a-storyboard-after-it-starts.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

3.1 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 [!INCLUDETLA2#tla_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 [!INCLUDETLA2#tla_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