`
net_liu
  • 浏览: 228500 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

模拟万象管理提示

阅读更多

模拟万象管理提示:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Clsmn {
	public partial class Form1 : Form {
		public Form1(string msg) {
			InitializeComponent();
			this.ShowMsg = msg;
		}
		public Form1() {
			InitializeComponent();
		}
		private string ShowMsg;
		private Point Work = new Point(SystemInformation.WorkingArea.Width - 275, SystemInformation.WorkingArea.Height);
		private void lblClose_Click(object sender, EventArgs e) {
			this.Close();
		}

		int time = 0;
		private void timer1_Tick(object sender, EventArgs e) {
			if(Work.Y < SystemInformation.WorkingArea.Height - this.Height) {
				time++;
				if(time > 300) {
					timer1.Stop();
					timer2.Start();
				}
			}
			else {
				this.Location = Work;
				Work = new Point(Work.X, Work.Y -= 6);
				this.Activate();
			}
		}

		private void timer2_Tick(object sender, EventArgs e) {
			this.Location = Work;
			Work = new Point(Work.X, Work.Y += 6);
			if(Work.Y > SystemInformation.WorkingArea.Height)
				Application.Exit();
		}

		private void Form1_Load(object sender, EventArgs e) {
			if(!string.IsNullOrEmpty(ShowMsg))
				this.lblMsg.Text = ShowMsg;
		}
	}
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics