鼠标放到图片上去图片就会自动随机一个位置让你很难点到它,点到后弹框
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Text = "竟然追到我了";
MessageBox.Show("你好厉害!嘿嘿嘿~");
}
private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
Random r = new Random();
int x = r.Next(0, this.ClientSize.Width - pictureBox1.Width);
int y = r.Next(0, this.ClientSize.Height - pictureBox1.Height);
pictureBox1.Location = new Point(x, y);
this.Text = "没追到!";
}
以上