Using System;
Using System. Drawing;
Using System. Collections;
Using System. ComponentModel;
Using System. Windows. Forms;
Namespace WindowsApplication2
{
/// <Summary>
/// Summary description of 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 ()
{
//
// Required features supported by the Windows Form Design Tool
//
Initializecomponent ();
//
// Todo: After the initializecomponent call, add Any constructor Handler
//
Init ();
}
Private void Init ()
{
This. heightmax = 120; // The animation height of the window.
This. widthmax = 148; // specifies the animation intensity of the window.
This. scrollshow ();
}
/// <Summary>
/// Clear any resources in use.
/// </Summary>
Protected override void dispose (bool disposing)
{
If (disposing)
{
If (components! = NULL)
{
Components. Dispose ();
}
}
Base. Dispose (disposing );
}
# Region windows Form Design Tool
/// <Summary>
/// The method required for the design tool support-do not use the program programming tool to modify
/// Content of this method.
/// </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. timerw.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 {
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 timerjavastick (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]; // capture screen changes
This. Location = new Point (screen. WorkingArea. Width-widthMax-20, screen. WorkingArea. Height-34); // WorkingArea is the work area of the Windows desktop.
This. timer2.Interval = StayTime;
This. timer4.Interval = StayTime;
}
}
}