///程序开始5秒后钟后每秒 AutoGetPutToSftpTimer = new System.Threading.Timer(new TimerCallback(AutoProg), this, 1000, 0);
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 WindowsFormsApplication12 { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { try { int i = int.Parse(this.label1.Text); if (i == 1) this.label1.Text = "5"; else this.label1.Text = (i - 1).ToString(); } catch { } } } } 你很懒 真的~~~~
private void timer1_Tick(object sender, EventArgs e)
{
if(i>=0)
{
this.label1.Text = i.ToString();
i--;
}
}
timer1.Start();
///程序开始5秒后钟后每秒 AutoGetPutToSftpTimer = new System.Threading.Timer(new TimerCallback(AutoProg), this, 1000, 0);
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 WindowsFormsApplication12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.timer1.Start();
} private void timer1_Tick(object sender, EventArgs e)
{
try
{
int i = int.Parse(this.label1.Text);
if (i == 1)
this.label1.Text = "5";
else
this.label1.Text = (i - 1).ToString();
}
catch
{
}
}
}
}
你很懒 真的~~~~
http://www.shareportal.com.cn/Class/Show.asp?ID=2272
public Form1()
{
InitializeComponent();
}
int ss = 4;
private void button1_Click(object sender, EventArgs e)
{
} private void Form1_Load(object sender, EventArgs e)
{
label1.Text = "5";
timer1.Interval = 1000;
timer1.Enabled = true;
} private void label1_Click(object sender, EventArgs e)
{ } private void timer1_Tick(object sender, EventArgs e)
{
switch(ss)
{
case 5:
label1.Text = ss.ToString();
ss--;
break;
case 4:
label1.Text = ss.ToString();
ss--;
break;
case 3:
label1.Text = ss.ToString();
ss--;
break;
case 2:
label1.Text = ss.ToString();
ss--;
break;
case 1:
label1.Text = ss.ToString();
ss = 5;
break;
default:
break;
}
}
{
int i = int.Parse(textBox5.Text) - 1;
textBox5.Text = i.ToString();
if (i == 0)
{
//你要做的事情!
}
}
求解...Visual Studio 2005 有Timer控件么?如果有该怎么弄出来
我的工具箱里没看见这个控件啊郁闷啊求解....
其他两个是System.Threading.Timer
System.Timers.Timer
我的是Visual studio 2005 的
如果确实是有 那我应该怎么把它们弄出来 需要下载么???如果要下载的话希望各位好心人能给个链接
感激不尽