- 487 名前:デフォルトの名無しさん mailto:sage [2007/12/11(火) 20:12:58 ]
- int x = 100, y = 200;
private Storyboard story; private DoubleAnimation myDoubleAnimation; private DoubleAnimation myDoubleAnimation2; private void WindowLoaded(object sender, RoutedEventArgs e) { Rectangle rect = new Rectangle(); rect.Width = 10; rect.Height = 10; . (省略 myDoubleAnimation = new DoubleAnimation(); myDoubleAnimation.From = 10; myDoubleAnimation.To = x; myDoubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(2000)); myDoubleAnimation2 = new DoubleAnimation(); myDoubleAnimation2.From = 10; myDoubleAnimation2.To = y; myDoubleAnimation2.Duration = new Duration(TimeSpan.FromMilliseconds(2000)); Storyboard.SetTargetName...(省略 story = new Storyboard(); story.Children.Add(myDoubleAnimation); story.Children.Add(myDoubleAnimation2); story.Begin(this, true); } private void click(object sender, RoutedEventArgs e) { story.Stop(this); x = 200; y = 300; story.Begin(this, true); } .NET3.0ですが、ストーリーボードの子要素の中身を変更するのってどうやるんでしょうか? xとyの値をクリックで変えたいのですが、上記の方法ではうまくいかず、 クリックしてもx,yは100,200のままで変わりません 。どうすればいいのでしょうか?
|

|