-
May 25th, 2009, 01:42 AM
#1
Thread Starter
Hyperactive Member
Stop Storyboard
Hi,
How do I stop a storyboard which is created in blend and programatically running from VB?
Thanks
-
May 26th, 2009, 12:40 PM
#2
Re: Stop Storyboard
whats wrong with Storyboard.Stop() ?
-
May 27th, 2009, 07:00 AM
#3
Thread Starter
Hyperactive Member
Re: Stop Storyboard
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
-
May 27th, 2009, 07:28 AM
#4
Re: Stop Storyboard
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:
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>
Then to stop it animating from a button click event handler in your code behind you could just do this:
vb.net Code:
DirectCast(FindResource("RotateSB"), Animation.Storyboard).Stop()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|