WindowsApplication1 

/// <summary> 
/// Form1 的摘要说明。 
/// </summary> 
public class Form1 : System.Windows.Forms.Form 

/// <summary> 
/// 必需的设计器变量。 
/// </summary> 
private System.ComponentModel.Container components = null

public Form1() 

// 
// Windows 窗体设计器支持所必需的 
// 
InitializeComponent(); 

// 
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码 
// 


/// <summary> 
/// 清理所有正在使用的资源。 
/// </summary> 
protected override void Dispose( bool disposing ) 

if( disposing ) 

if (components != null

components.Dispose(); 


base.Dispose( disposing ); 


#region Windows 窗体设计器生成的代码 
/// <summary> 
/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
/// 此方法的内容。 
/// </summary> 
private void InitializeComponent() 

// 
// Form1 
// 
this.AutoScaleBaseSize = new System.Drawing.Size(614); 
this.ClientSize = new System.Drawing.Size(344302); 
this.Name = "Form1"
this.Text = "Form1"
this.Load += new System.EventHandler(this.Form1_Load); 


#endregion 

/// <summary> 
/// 应用程序的主入口点。 
/// </summary> 
[STAThread] 
static void Main() 

Application.Run(
new Form1()); 


private void Form1_Load(object sender, System.EventArgs e) 

this.Top=Screen.PrimaryScreen.Bounds.Height;//得到高 
this.Left=Screen.PrimaryScreen.WorkingArea.Width-this.Width;//得到X坐标 
Thread th=new Thread(new ThreadStart(ChangeThisPoint));//绑定改变坐标的方法 
th.IsBackground=true;//设置为后台线程 
th.Start();//起启动线程 

public void ChangeThisPoint() 


Thread.Sleep(
500); 
while(this.Bottom>Screen.PrimaryScreen.WorkingArea.Height)//从无到有 

this.Top--
Thread.Sleep(
10); 




Thread.Sleep(
6000); 
while(this.Top <Screen.PrimaryScreen.Bounds.Height)//从有到无 

this.Top++
Thread.Sleep(
10); 

this.Close(); 



相关文章: