56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
|
|
namespace ASillyDog
|
|||
|
|
{
|
|||
|
|
public partial class Form1 : Form
|
|||
|
|
{
|
|||
|
|
public Form1()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
this.FormClosing += Form1_FormClosing;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void Form1_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.CloseReason == CloseReason.UserClosing)
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD> Alt + F4 <20><><EFBFBD><EFBFBD><EFBFBD>Ĺر<C4B9>
|
|||
|
|
if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt && (Control.ModifierKeys & Keys.F4) == Keys.F4)
|
|||
|
|
{
|
|||
|
|
// ȡ<><C8A1><EFBFBD>رղ<D8B1><D5B2><EFBFBD>
|
|||
|
|
e.Cancel = true;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رհ<D8B1>ť<EFBFBD><C5A5>
|
|||
|
|
e.Cancel = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void button1_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
// MessageBox.Show("<22><>ť<EFBFBD><C5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void button2_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֪֮<D6AA><D6AE><EFBFBD><EFBFBD>~");
|
|||
|
|
this.Close();
|
|||
|
|
Application.Exit();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void button1_MouseEnter(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Button button = (Button)sender;
|
|||
|
|
Random random = new Random();
|
|||
|
|
int x = random.Next(0, this.ClientSize.Width - button.Width);
|
|||
|
|
int y = random.Next(0, this.ClientSize.Height - button.Height);
|
|||
|
|
button.Location = new Point(x, y);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|