模仿了一下网上不想上课的那个小程序。。。。

public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_MouseEnter(object sender, EventArgs e)
{
button2_MouseHover(null, null);
}
Point p1 = new Point();
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("你真是个好孩子!(づ ̄ 3 ̄)づ");
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
button2.Location = p1;
}
private void button2_MouseHover(object sender, EventArgs e)
{
if (p1 != button2.Location)
{
button2.Location = p1;
}
else
{
Point p = new Point();
p.X = 1;
p.Y = 1;
button2.Location = p;
}
}
private void Form1_Load(object sender, EventArgs e)
{
p1 = button2.Location;
}
}

posted @ 2016-09-05 16:48  Magic_Cc  阅读(210)  评论(0编辑  收藏  举报