using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Stone.Common.WinModule { public partial class frmMessagePop : Form { public int TimerCount = 0; public frmMessagePop() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { this.lblTimer.Text = TimerCount.ToString() + " 后自动关闭..."; this.lblTimer.Update(); if ( TimerCount <= 0) { timer1.Enabled = false; this.Close(); this.Dispose(); } TimerCount--; } private void frmMessagePop_Load(object sender, EventArgs e) { //设定窗口启动时的位置为右下角 this.Left = Screen.PrimaryScreen.WorkingArea.Width - this.Width - 5; this.Top = Screen.PrimaryScreen.WorkingArea.Height - this.Height; } private void btnOK_Click(object sender, EventArgs e) { this.Close(); this.Dispose(); } } }