扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:徐长友 来源:悠游在线 2007年11月14日
关键字:
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace pop3 { /// <summary> /// Summary description for WinForm1. /// </summary> public class WinForm1 : System.Windows.Forms.Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components; private System.Windows.Forms.Timer timer1; private System.Windows.Forms.Timer timer2; private System.Windows.Forms.Timer timer3; private System.Windows.Forms.LinkLabel linkLabel1; public string str_num; public WinForm1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } /// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose (bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WinForm1)); this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer2 = new System.Windows.Forms.Timer(this.components); this.timer3 = new System.Windows.Forms.Timer(this.components); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.SuspendLayout(); // // timer1 // this.timer1.Interval = 10; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // timer2 // this.timer2.Interval = 10; this.timer2.Tick += new System.EventHandler(this.timer2_Tick); // // timer3 // this.timer3.Interval = 10; this.timer3.Tick += new System.EventHandler(this.timer3_Tick); // // linkLabel1 // this.linkLabel1.AutoSize = true; this.linkLabel1.BackColor = System.Drawing.Color.WhiteSmoke; this.linkLabel1.Location = new System.Drawing.Point(56, 56); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(79, 17); this.linkLabel1.TabIndex = 0; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "您有新邮件!"; // // WinForm1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.SystemColors.Info; this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = new System.Drawing.Size(194, 122); this.Controls.Add(this.linkLabel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "WinForm1"; this.ShowInTaskbar = false; this.Text = "信息提示"; this.TopMost = true; this.Load += new System.EventHandler(this.WinForm1_Load); this.Activated += new System.EventHandler(this.WinForm1_Activated); this.ResumeLayout(false); } #endregion private void WinForm1_Load(object sender, System.EventArgs e) { Screen[] screens = Screen.AllScreens; Screen screen = screens[0]; this.Location = new Point(screen.WorkingArea.Width - 200, screen.WorkingArea.Height - 30); this.timer2.Interval = 5000; } private void ScrollUp() { if(Height < 122) { this.Height += 3; this.Location = new Point(this.Location.X, this.Location.Y - 3); } else { this.timer1.Enabled = false; this.timer2.Enabled = true; } } private void ScrollDown() { if(Height > 3) { this.Height -= 3; this.Location = new Point(this.Location.X, this.Location.Y + 3); } else { this.timer3.Enabled = false; this.Close(); } } private void timer1_Tick(object sender, System.EventArgs e) { ScrollUp(); } private void timer2_Tick(object sender, System.EventArgs e) { timer2.Enabled = false; timer3.Enabled = true; } private void timer3_Tick(object sender, System.EventArgs e) { ScrollDown(); } public void ScrollShow() { this.Width = 194; this.Height = 0; this.Show(); this.timer1.Enabled = true; } private void WinForm1_Activated(object sender, System.EventArgs e) { linkLabel1.Text="您有"+str_num+"封新邮件!"; } } } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者