# How to make a loop of the storyboard in c#

**URL:** <https://forum.kirupa.com/t/how-to-make-a-loop-of-the-storyboard-in-c/302923>\
**Category:** Uncategorized\
**Created:** [January 10, 2010, 5:56am UTC](https://forum.kirupa.com/t/how-to-make-a-loop-of-the-storyboard-in-c/302923 "2010-01-10T05:56:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![askit](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@askit](https://forum.kirupa.com/u/askit)\
**Post date:** [January 10, 2010, 5:56am UTC](https://forum.kirupa.com/t/how-to-make-a-loop-of-the-storyboard-in-c/302923/1 "2010-01-10T05:56:30Z")

</div>

I wished to make a loop for the Storyboard I made in XAML from c#.

void controlStoryboard()  
{  
for (int x= 0; x!=3; x++)  
{  
Storyboard xStart =(Storyboard)this.Resources[“storyboard1”];  
xStart.RepeatBehavior = new RepeatBehavior(3);  
textBlock.BeginStoryboard(xStart);  
}  
}

storyboard1 is the name of the Storyboard. Its not kinda working with me. I’d be glad if anyone can help. Thank you in advance.
