Timer的使用

csl610 2004-04-15 12:36:24
我要在按下一个BUTTON (另外一个BUTTON是隐藏的)后,30秒后另外一个BUTTON显示,我怎样写代码?
谢谢
...全文
72 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
minajo21 2004-04-15
  • 打赏
  • 举报
回复
this.timer1.Interval = 30000

// 单位为毫秒
minajo21 2004-04-15
  • 打赏
  • 举报
回复
private void Form1_Load(object sender, System.EventArgs e)
{
this.timer1.Enabled = false;
this.timer1.Interval = 3000;
}

private void button1_Click(object sender, System.EventArgs e)
{
this.timer1.Enabled =true;

}


private void timer1_Tick(object sender, System.EventArgs e)
{
this.button2.Visible = true;
}
csl610 2004-04-15
  • 打赏
  • 举报
回复
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
this.timer1.Enabled = false;
this.timer1.Interval = 3000;
this.Button2.Visible=false;
}
我是在asp.net web应用程序中做的
csl610 2004-04-15
  • 打赏
  • 举报
回复
这样还是不行
有其他方法做吗
China200878 2004-04-15
  • 打赏
  • 举报
回复
Up.
如果闪动的话可以:
private void timer1_Tick(object sender, System.EventArgs e)
{
if(this.button2.Visible == false)
this.button2.Visible = true;
else
this.button2.Visible = false;

}

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧