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 LoveOrNot { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_MouseEnter(object sender, EventArgs e) { if (button1.Text == "不是") { button1.Text = "是的"; button2.Text = "不是"; } } int N2 = 0; private void button2_MouseEnter(object sender, EventArgs e) { if (button2.Text == "不是" && N2 == 0) { N2 = N2 + 1; button2.Visible = false; button3.Visible = true; } else if(button2.Text == "不是") { //N2 = N2 + 1; button2.Text = "是的"; button1.Text = "不是"; } } private void button2_Click(object sender, EventArgs e) { MessageBox.Show("就知道你喜欢我!"); N = N + 1; this.Close(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("就知道你喜欢我!"); N = N + 1; this.Close(); } int N = 0; private void Form1_FormClosed(object sender, FormClosedEventArgs e) { } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (N == 0) { MessageBox.Show("关闭窗口也改变不了喜欢我的事实!"); e.Cancel = true; } } private void button3_Click(object sender, EventArgs e) { MessageBox.Show("就知道你喜欢我!"); N = N + 1; this.Close(); } private void button3_MouseDown(object sender, MouseEventArgs e) { } private void button3_MouseEnter(object sender, EventArgs e) { if (button3.Text == "不是") { button2.Visible = true; button3.Visible = false; } } } }
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596