winform Thread th = new Thread(new ThreadStart(() =>
{
for (int i = 0; i < 255; i++)
{
this.label1.Invoke(new Action(() => this.label1.BackColor = Color.FromArgb(i, i, i)));
Thread.Sleep(20);
}
}));
th.Start();
wpf double d=1.0;
Thread th = new Thread(new ThreadStart(() =>
{
for (int i = 0; i < 10; i++)
{
this.lbl.Dispatcher.Invoke(() => this.lbl.Opacity = d);
d -= 0.1;
Thread.Sleep(200);
}
}));
th.Start();
{
for (int i = 0; i < 255; i++)
{
this.label1.Invoke(new Action(() => this.label1.BackColor = Color.FromArgb(i, i, i)));
Thread.Sleep(20);
}
}));
th.Start();
wpf double d=1.0;
Thread th = new Thread(new ThreadStart(() =>
{
for (int i = 0; i < 10; i++)
{
this.lbl.Dispatcher.Invoke(() => this.lbl.Opacity = d);
d -= 0.1;
Thread.Sleep(200);
}
}));
th.Start();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货