我有一个带有背景图像集的表单和一个用作计时器输出的标签。标签位于透明的表格布局面板中。不幸的是,随着计时器的每一次滴答,背景都会明显刷新。我怎样才能防止这种情况?
这是每个刻度调用的函数。
private void DisplayCountry()
{
if (sel.Count == 1)
{
country_out.Text = "No countries chosen.\nPlease select some.";
timer_out.Visible = false;
}
else{
timer_out.Text = String.Format("{0:00}", (sel[i].elapsed / 60)) + ":" + String.Format("{0:00}", (sel[i].elapsed % 60));
if (sel[i] == "sent")
{
country_out.Text = "No countries left.";
timer_out.Visible = false;
}
else
{
timer_out.Visible = true;
country_out.ForeColor = Color.RoyalBlue;
country_out.Text = sel[i].name;
if (sel[i].elapsed > REDTIME)
timer_out.ForeColor = Color.SteelBlue;
else
timer_out.ForeColor = Color.Tomato;
}
}
}