请看看我写的有问题么?

mowensky 2009-09-25 10:27:24
private void FirestAni_MouseEnter(object sender, MouseEventArgs e)
{
Thread t1 = new Thread(new ParameterizedThreadStart(Animation));
t1.Start();
}
void Animation()
{
while (true)
{
DoubleAnimation widthAnimation = new DoubleAnimation();
widthAnimation.From = FirestAni.ActualWidth;
widthAnimation.To = this.Width - 30;
widthAnimation.AutoReverse = true;
widthAnimation.Completed += animation_Completed;
FirestAni.BeginAnimation(Button.WidthProperty, widthAnimation);
}
}

报的错误是:No overload for 'Animation' matches delegate 'System.Threading.ParameterizedThreadStart'
...全文
41 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
mowensky 2009-09-25
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 ttojj 的回复:]
  Thread t1 = new Thread(new ParameterizedThreadStart(Animation));

改成Thread t1 = new Thread(new ThreadStart(Animation));
[/Quote]

可以了
mowensky 2009-09-25
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xzq686 的回复:]
C# codeprivatevoid FirestAni_MouseEnter(object sender, MouseEventArgs e)
{
Thread t1=new Thread(Animation);//这里试试 t1.Start();
}void Animation()
{while (true)
¡­
[/Quote]

还是报同样的错
TTOJJ 2009-09-25
  • 打赏
  • 举报
回复
Thread t1 = new Thread(new ParameterizedThreadStart(Animation));

改成Thread t1 = new Thread(new ThreadStart(Animation));
xzq686 2009-09-25
  • 打赏
  • 举报
回复

private void FirestAni_MouseEnter(object sender, MouseEventArgs e)
{
Thread t1 = new Thread(Animation); //这里试试
t1.Start();
}

void Animation()
{
while (true)
{
DoubleAnimation widthAnimation = new DoubleAnimation();
widthAnimation.From = FirestAni.ActualWidth;
widthAnimation.To = this.Width - 30;
widthAnimation.AutoReverse = true;
widthAnimation.Completed += animation_Completed;
FirestAni.BeginAnimation(Button.WidthProperty, widthAnimation);
}
}




110,502

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧