Hi,
How do I stop a storyboard which is created in blend and programatically running from VB?
Thanks
Printable View
Hi,
How do I stop a storyboard which is created in blend and programatically running from VB?
Thanks
whats wrong with Storyboard.Stop() ? :)
It is not working. My intention is to circulate a search icon while processing a search in the folders. I have a stop button too which when clicked should stop the animation. Hence I created a storyboard that circulates as required, but does not stop when the stop button is clicked. So I created another storyboad that does not move, which stays still. Now the problem is, when the processing is being done, the image is not circulating correctly. It stops in between and then continues.
Thanks
Not sure quite what you've done, but this is how I would do it:
Lets say you were trying to rotate a button, your storyboard might be defined like so in your window resources like so:
Then to stop it animating from a button click event handler in your code behind you could just do this:Code:<Window.Resources>
<Storyboard x:Key="RotateSB">
<DoubleAnimation
Storyboard.TargetName="Button1"
Storyboard.TargetProperty="(RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:3"
AutoReverse="False" RepeatBehavior="Forever" />
</Storyboard>
</Window.Resources>
vb.net Code:
DirectCast(FindResource("RotateSB"), Animation.Storyboard).Stop()