在窗体上显示倒计时隐藏窗体

#region 倒计时
private int leftTime = 10;
private void timer2_Tick(object sender, EventArgs e)
{
if (currentEmployee != null && currentEmployee.IsEmployee)
{
this.lbInfo.Text = "您好!" + tmpEB.DeptName + " " + tmpEB.Name;
TaskNotifier taskn
= new TaskNotifier(currentEmployee);
//this.Hide();
//notifyIcon1.Visible = true;
if (leftTime >= 10)
{
this.lbTimer.Text = "待办事宜提醒还有" + leftTime.ToString() + "秒将自动开启!";
}
else
{
this.lbTimer.Text = "待办事宜提醒还有0" + leftTime.ToString() + "秒将自动开启!";
}
if (leftTime == 0)
{
//倒计时到“00”,计时器停止
this.timer2.Stop();
this.Hide();
notifyIcon1.Visible
= true;
}
else
{
leftTime
--;
}
}
else
{
this.Close();
}
}
#endregion
posted @ 2011-01-20 10:17  盛行天宇  阅读(380)  评论(0)    收藏  举报