123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- 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();
- }
- /// <summary>
- /// Проверка выигрыша
- /// </summary>
- private void CheckWin()
- {
- if (!lblTopLeft.Visible && !lblTopRight.Visible && !lblBottomLeft.Visible && !lblBottomRight.Visible)
- {
- MessageBox.Show("Поздравляю! Вы сделали что-то(?)");
- Close();
- }
- }
- /// <summary>
- /// Клик левой верхней кнопки
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnTopLeft_Click(object sender, EventArgs e)
- {
- lblBottomRight.Visible = !lblBottomRight.Visible;
- CheckWin();
- }
- /// <summary>
- /// Клик правой верхней кнопки
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnTopRight_Click(object sender, EventArgs e)
- {
- lblBottomRight.Visible = !lblBottomRight.Visible;
- lblBottomLeft.Visible = !lblBottomLeft.Visible;
- CheckWin();
- }
- /// <summary>
- /// Клик нижней левой кнопки
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnBottomLeft_Click(object sender, EventArgs e)
- {
- lblTopRight.Visible = !lblTopRight.Visible;
- lblBottomRight.Visible = !lblBottomRight.Visible;
- CheckWin();
- }
-
- /// <summary>
- /// Клик правой нижней кнопки
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void btnBottomRight_Click(object sender, EventArgs e)
- {
- lblTopLeft.Visible = !lblTopLeft.Visible;
- CheckWin();
- }
- }
- }
|