![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Animate Min/Max windows turns itself off | Vista performance & maintenance | |||
| animate the dialup icon? | Vista General | |||
| Q: Tray | Connections -> Animations. Can't get mine to animate??? | Vista General | |||