该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TimerDemo
{
public partial class Form1 : Form
{
int count = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 2000;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (count<5)
{
count++;
//写你要做的事情
}
else
{
timer1.Stop();
}
}
}
}