C♯, C#相談室 Part3 ..
[2ch|▼Menu]
487:デフォルトの名無しさん
07/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のままで変わりません 。どうすればいいのでしょうか?


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5089日前に更新/202 KB
担当:undef