网红表白程序-你要愿意爱我一辈子吗?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace 你愿意陪我一辈子吗_
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int x=500, y=300;
Random random = new Random();//产生随机数
Point po = new Point(); private void button1_Click(object sender, EventArgs e)
{
x = random.Next(Size.Width-button1.Size.Width);
y = random.Next(Size.Height-button1.Size.Height);
po = new Point(x, y); button1.Location = po;
} private void button2_Click(object sender, EventArgs e)
{
label1.Text = "谢谢你能够陪我一辈子!";
label1.ForeColor = Color.Red ;
} private void Form1_Load(object sender, EventArgs e)
{
po = new Point(x,y);
button1.Location = po;
button1.Text = "不愿意";
button2.Text = "愿意";
label1.BackColor = Color.Transparent;
label1.ForeColor = Color.Yellow; label1.Text = "你愿意陪伴我一辈子吗?";
}
}
}
评论