开发的是winform程序。
private void timer1_Tick_1(object sender, EventArgs e)
{
textBox1.Text = DateTime.Now.ToString();
timer1.Start();
MessageBox.Show("刷新啦刷新啦", "提示", MessageBoxButtons.OK);
}
就是这样最简单的代码都实现不了。求求各位帮帮我吧,怎样让我的Timer空间好用。
private void timer1_Tick_1(object sender, EventArgs e)
{
textBox1.Text = DateTime.Now.ToString();
timer1.Start();
MessageBox.Show("刷新啦刷新啦", "提示", MessageBoxButtons.OK);
}
就是这样最简单的代码都实现不了。求求各位帮帮我吧,怎样让我的Timer空间好用。
默认是false,刚才写错了
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = false;
timer1.Start();
MessageBox.Show("刷新啦刷新啦", "提示", MessageBoxButtons.OK);
}这没问题,timer事件一样会触发楼主看看Interval属性
是不是太大了
或者在窗体加载中把这两行加进去:
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
}