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 simple_game { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void CheckWin() { if (!lblTopLeft.Visible && !lblTopRight.Visible && !lblBottomLeft.Visible && !lblBottomRight.Visible) { MessageBox.Show("Поздравляю! Вы сделали что-то(?)"); Close(); } } private void btnTopLeft_Click(object sender, EventArgs e) { lblBottomRight.Visible = !lblBottomRight.Visible; CheckWin(); } private void btnTopRight_Click(object sender, EventArgs e) { lblBottomRight.Visible = !lblBottomRight.Visible; lblBottomLeft.Visible = !lblBottomLeft.Visible; CheckWin(); } private void btnBottomLeft_Click(object sender, EventArgs e) { lblTopRight.Visible = !lblTopRight.Visible; lblBottomRight.Visible = !lblBottomRight.Visible; CheckWin(); } private void btnBottomRight_Click(object sender, EventArgs e) { lblTopLeft.Visible = !lblTopLeft.Visible; CheckWin(); } } }