惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
月光博客
月光博客
S
SegmentFault 最新的问题
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
人人都是产品经理
人人都是产品经理
K
Kaspersky official blog
Forbes - Security
Forbes - Security
宝玉的分享
宝玉的分享
爱范儿
爱范儿
V
Visual Studio Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
The Cloudflare Blog
Attack and Defense Labs
Attack and Defense Labs
美团技术团队
L
LangChain Blog
NISL@THU
NISL@THU
IT之家
IT之家
T
Tor Project blog
云风的 BLOG
云风的 BLOG
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
Help Net Security
Help Net Security
Engineering at Meta
Engineering at Meta
Know Your Adversary
Know Your Adversary
I
Intezer
Recent Commits to openclaw:main
Recent Commits to openclaw:main
TaoSecurity Blog
TaoSecurity Blog
P
Palo Alto Networks Blog
GbyAI
GbyAI
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - Franky
L
Lohrmann on Cybersecurity
The Register - Security
The Register - Security
W
WeLiveSecurity
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY

博客园 - 飞鼠

面试时英语自我介绍范文 判斷一天是否是年月中正確的日 - 飞鼠 - 博客园 Javascript中parseInt的一個問題 NUMERIC(3,1) 的含義 在 google 里找书下载的捷径 - 飞鼠 使用asp.net发送邮件详解 創建用戶控件 - 飞鼠 - 博客园 SQL密码 datagrid用xml作为数据源,并且有更新,删除和排序的操作(VB) - 飞鼠 - 博客园 将xml作为DataGrid 操作(Sort, Edit, Delete) - 飞鼠 用ASP.NET结合XML制作广告管理程序 用ASP.NET结合XML制作广告管理程序(2) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(下)(转载) - 飞鼠 - 博客园 XML、DataSet、DataGrid结合写成广告管理程序(上)(转载) 分别用DataGrid、Repeater、DataList绑定XML数据的例子 - 飞鼠 - 博客园 将某一目录下的所有相同格式的 XML文件绑定到不同的DataGrid - 飞鼠 - 博客园 创建可编辑的xml文档(之五)执行中的treeview 控件 创建可编辑的xml文档(之四) 删除、改名、插入操作 创建可编辑的xml文档(之三)执行拖放操作
不斷提醒
飞鼠 · 2005-12-31 · via 博客园 - 飞鼠

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsApplication2
{
 /// <summary>
 /// Form2 的摘要描述。
 /// </summary>
 public class Form2 : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Timer timer1;
  private System.Windows.Forms.Timer timer2;
  private System.Windows.Forms.Timer timer3;
  private System.Windows.Forms.Timer timer4;
  private System.ComponentModel.IContainer components;

  [STAThread]
  static void Main()
  {
   Application.Run(new Form2());
  }

  public Form2()
  {
   //
   // Windows Form 設計工具支援的必要項
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 呼叫之後加入任何建構函式程式碼
   //
   Init();
  }

  private void Init()
  {
   this.HeightMax = 120;//窗體滾動的高度
   this.WidthMax = 148;//窗體滾動的寬度
   this.ScrollShow();
  }


  /// <summary>
  /// 清除任何使用中的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if(components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows Form 設計工具產生的程式碼
  /// <summary>
  /// 此為設計工具支援所必須的方法 - 請勿使用程式碼編輯器修改
  /// 這個方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.components = new System.ComponentModel.Container();
   this.label1 = new System.Windows.Forms.Label();
   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.timer4 = new System.Windows.Forms.Timer(this.components);
   this.SuspendLayout();
   //
   // label1
   //
   this.label1.BackColor = System.Drawing.Color.Teal;
   this.label1.Font = new System.Drawing.Font("新細明體", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(136)));
   this.label1.ForeColor = System.Drawing.Color.White;
   this.label1.Location = new System.Drawing.Point(24, 56);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(104, 24);
   this.label1.TabIndex = 0;
   this.label1.Text = "Welcome";
   //
   // 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);
   //
   // timer4
   //
   this.timer4.Interval = 10;
   this.timer4.Tick += new System.EventHandler(this.timer4_Tick);
   //
   // Form2
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
   this.BackColor = System.Drawing.Color.Teal;
   this.ClientSize = new System.Drawing.Size(152, 136);
   this.Controls.Add(this.label1);
   this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
   this.Name = "Form2";
   this.ShowInTaskbar = false;
   this.Text = "Form2";
   this.TopMost = true;
   this.Load += new System.EventHandler(this.Form2_Load);
   this.ResumeLayout(false);

  }
  #endregion

  private int heightMax, widthMax;
  public int HeightMax
  {
   set
   {
    heightMax = value; 
   }
   get
   {
    return heightMax;
   }
  }

  public int WidthMax
  {
   set
   {
    widthMax = value;
   }
   get
   {
    return widthMax;
   }
  }

  public void ScrollShow()
  {
   this.Width = widthMax;
   this.Height = 0;
   this.Show();
   this.timer1.Enabled = true;
  }

  public int StayTime = 5000;
  public int StayTime = 20000;

  private void ScrollUp()
  {
   if(Height < heightMax)
   {
    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();
    this.timer4.Enabled = true;
   }
  }

  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();
  }

  private void timer4_Tick(object sender, System.EventArgs e)
  {
   timer4.Enabled=false;
   timer1.Enabled=true;
  }

  private void Form2_Load(object sender, System.EventArgs e)
  {
   Screen[] screens = Screen.AllScreens;
   Screen screen = screens[0];//獲取屏幕變量
   this.Location = new Point(screen.WorkingArea.Width - widthMax - 20, screen.WorkingArea.Height - 34);//WorkingArea為Windows桌面的工作區
   this.timer2.Interval = StayTime;
   this.timer4.Interval = StayTime;
  }

 }
}