我做的:
int a = 9;
int b = 9;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 1000;
timer1.Enabled = false;
toolTip1.SetToolTip(button1, "启动定时控件");
toolTip1.SetToolTip(button2, "停止定时控件");
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
}
private void timer1_Tick(object sender, EventArgs e)
{
if(a<30&&b==9)
{
a++;
label1.Font = new Font("",a);
if (a == 30)
b = 30;
}
if (b <30&&a == 30)
{
b--;
label1.Font = new Font("",b);
if (b == 9)
a = 9;
}
label1.ForeColor = Color.Red;
}