IUIAnimationStoryboard::RepeatBetweenKeyframes method (uianimation.h)

Creates a loop between two specified keyframes.


HRESULT RepeatBetweenKeyframes(
  [in] UI_ANIMATION_KEYFRAME startKeyframe,
  [in] UI_ANIMATION_KEYFRAME endKeyframe,
  [in] INT32                 repetitionCount


[in] startKeyframe

The keyframe at which the loop is to begin.

[in] endKeyframe

The keyframe at which the loop is to end. It must not be possible for endKeyframe to occur earlier in the storyboard than startKeyframe.

[in] repetitionCount

The number of times the loop is to be repeated; this parameter must be 0 or a positive number. Use UI_ANIMATION_REPEAT_INDEFINITELY (-1) to repeat the loop indefinitely until the storyboard is trimmed or concluded.

Return value

If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See Windows Animation Error Codes for a list of error codes.

Return code Description
The start keyframe might occur after the end keyframe.
It might not be possible to determine the end keyframe time when the start keyframe is reached.
Two repeated portions of a storyboard might overlap.


This method directs a storyboard to play the interval between the given keyframes repeatedly before playing the remainder of the storyboard. If a finite repetition count is specified, the loop always plays that number of times. If UI_ANIMATION_REPEAT_INDEFINITELY (-1) is specified, the loop repeats until the storyboard is concluded, in which case the current iteration of the loop completes and the remainder of the storyboard plays. A storyboard that loops indefinitely also ends if it is truncated.

Nested and overlapping loops are not supported.

A keyframe represents a moment in time within a storyboard and can be used to specify the start or end times of transitions. Because keyframes can be added at the ends of transitions, their offsets from the start of the storyboard may not be known until the storyboard is playing.


Minimum supported client Windows 7, Windows Vista and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server None supported
Target Platform Windows
Header uianimation.h
DLL UIAnimation.dll

See also