WPFアプリで、ボタンと円を貼り付けて、ボタンのクリックイベントに以下のコードを書いただけです。
private void button1_Click(object sender, RoutedEventArgs e)
{
var timer = new Timer((o) =>
{
this.ellipse1.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
{
this.ellipse1.Height++;
this.ellipse1.Width++;
if (this.ellipse1.Height > 100) this.ellipse1.Height = 1;
if (this.ellipse1.Width > 100) this.ellipse1.Width = 1;
}));
}, null, 0, 10);
}
ただ使ってみただけなので、原因を追及する気もありません。
一応zipで置いておきます。
"StopTimer.zip"
0 件のコメント:
コメントを投稿