110,567
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("aaa");
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 60000;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("1 min");
}
Timer timer1 = new Timer();
timer1.Interval = 60*1000;
timer1.Tick + = new System.EventHandler(this.timer1_Tick);
private void timer1_Tick(object sender, EventArgs e)
{
MessageBox.Show("aaaaa");
}
Button btnStar = new Button();
btnStar.Text = "开始";
btnStar.Click += new System.EventHandler(btnStar_Click);
private void btnStar_Click(object sender, EventArgs e)
{
timer1.Star();
}