Results 1 to 4 of 4

Thread: Stop Storyboard

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Location
    India
    Posts
    318

    Stop Storyboard

    Hi,

    How do I stop a storyboard which is created in blend and programatically running from VB?

    Thanks

  2. #2
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Stop Storyboard

    whats wrong with Storyboard.Stop() ?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2003
    Location
    India
    Posts
    318

    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

  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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:
    1. DirectCast(FindResource("RotateSB"), Animation.Storyboard).Stop()
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width