![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How do I animate Canvas.Left in code? I'm trying to animate the position of a button that is a child of a Canvas control. Run I run my app, though, the control doesn't move. Here is the code I'm trying: DoubleAnimation buttonAnimation = new DoubleAnimation(); buttonAnimation.From = currentYValue; buttonAnimation.To = newYValue; buttonAnimation.Duration = new Duration(TimeSpan.FromSeconds(1)); myButton.BeginAnimation(Canvas.TopProperty, buttonAnimation); Any ideas? Is there something wrong with my code? Should I be writing it a different way? Thanks, --Jeremy |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: How do I animate Canvas.Left in code? This code should work, what do you use as currentYValue, and newYValue? From where is this code called? On Jul 21, 3:05 am, Jeremy Chaney <j...@telestream.net> wrote: > I'm trying to animate the position of a button that is a child of a > Canvas control. Run I run my app, though, the control doesn't move. Here > is the code I'm trying: > > DoubleAnimation buttonAnimation = new DoubleAnimation(); > > buttonAnimation.From = currentYValue; > buttonAnimation.To = newYValue; > buttonAnimation.Duration = new Duration(TimeSpan.FromSeconds(1)); > > myButton.BeginAnimation(Canvas.TopProperty, buttonAnimation); > > Any ideas? Is there something wrong with my code? Should I be writing it > a different way? > > Thanks, > --Jeremy |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Animate Min/Max disabling itself, Aero, Vista Ultimate x64 | grayprint | General Discussion | 13 | 05-07-2008 06:02 AM |
| Animate Min/Max windows turns itself off | Q | Vista performance & maintenance | 6 | 02-21-2008 01:31 AM |
| animate the dialup icon? | Jrz | Vista General | 4 | 12-13-2007 04:07 PM |
| How to animate To/From an Auto value? | Shawnk | Avalon | 9 | 02-15-2007 01:23 PM |
| Cannot animate a transform in a data template | viliescu | Avalon | 6 | 01-10-2006 03:52 PM |