bool
page_ =
true
;
private
void
button2_Click(
object
sender, EventArgs e)
{
page_ =
false
;
Point point =
new
Point(label1.Location.X, label1.Location.Y - textBox1.Size.Height - 5);
label1.Text =
"V50后获取密码:"
;
label1.Location = point;
}
private
void
button1_MouseEnter(
object
sender, EventArgs e)
{
Random rd =
new
Random();
int
i = rd.Next(0, Size.Width - 15);
int
n = rd.Next(0, Size.Height - 40);
button1.Location =
new
Point(i, n);
this
.WindowState = FormWindowState.Maximized;
label1_Paint(
null
,
null
);
}
private
void
button1_MouseHover(
object
sender, EventArgs e)
{
Random rd =
new
Random();
int
i = rd.Next(0, Size.Width - 15);
int
n = rd.Next(0, Size.Height - 40);
button1.Location =
new
Point(i, n);
}
private
void
button1_MouseDown(
object
sender, MouseEventArgs e)
{
Random rd =
new
Random();
int
i = rd.Next(0, Size.Width - 15);
int
n = rd.Next(0, Size.Height - 40);
button1.Location =
new
Point(i, n);
}
private
void
button1_MouseUp(
object
sender, MouseEventArgs e)
{
Random rd =
new
Random();
int
i = rd.Next(0, Size.Width - 15);
int
n = rd.Next(0, Size.Height - 40);
button1.Location =
new
Point(i, n);
}
private
void
label1_Paint(
object
sender, PaintEventArgs e)
{
if
(page_)
{
Point point =
new
Point((Size.Width / 2) - (label1.Size.Width / 2), (Size.Height / 2) - (label1.Size.Height / 2));
label1.Location = point;
point =
new
Point((Size.Width / 2) - (textBox1.Size.Width / 2), (Size.Height / 2) - (textBox1.Size.Height / 2));
textBox1.Location = point;
textBox1.Hide();
point =
new
Point((Size.Width / 2) - (textBox1.Size.Width / 2) + 13, (Size.Height / 2) + (textBox1.Size.Height));
button3.Location = point;
button3.Hide();
point =
new
Point((Size.Width / 2) - (panel1.Size.Width / 2), Size.Height - 2 * panel1.Size.Height);
panel1.Location = point;
panel1.Hide();
comboBox1.SelectedIndex = 0;
}
else
{
Point point =
new
Point(label1.Location.X, label1.Location.Y - textBox1.Size.Height - 5);
label1.Text =
"V50后获取密码:"
;
label1.Location = point;
textBox1.Show();
button1.Hide();
button2.Hide();
button3.Show();
panel1.Show();
}
}
private
void
button3_Click(
object
sender, EventArgs e)
{
if
(textBox1.Text ==
"糟老头子坏得很"
)
{
MessageBox.Show(
"每个人都有自己的路\r\n只要不走下面的路就好"
);
System.Environment.Exit(0);
}
else
{
MessageBox.Show(
"相信我,真的需要密码"
);
}
}
private
void
Form1_KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.KeyCode == Keys.Enter)
{
button3_Click(
null
, EventArgs.Empty);
}
e.Handled =
true
;
}
private
void
textBox1_KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.KeyCode == Keys.Enter)
{
button3_Click(
null
, EventArgs.Empty);
}
}
private
void
button4_Click(
object
sender, EventArgs e)
{
DialogResult rst = MessageBox.Show(
this
,
"真的打算如此吗?\r\n这条路只有0次和无数次!!!"
,
"提示"
, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if
(rst == DialogResult.Yes)
{
MessageBox.Show(
"每个人都有自己的路\r\n但你的路太离谱了!!!"
);
Application.ExitThread();
Application.Exit();
}
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
panel1.Hide();
button4.Hide();
}
private
void
comboBox1_Click(
object
sender, EventArgs e)
{
button4.Show();
}