using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Game1
{
    public partial class Form1 : Form
    {
        int Count = 0;
        public Form1()
        {
            InitializeComponent();
        }

       
        private void Form1_Click(object sender, EventArgs e)
        {
            Count++;
            this.Text = "بازی  :" + "تعداد کلیک ها " + Count.ToString();
            if (Count >= 6)
            {
                Count = 0;
                Cursor.Show();
                MessageBox.Show("شما بازنده شدید");
                Cursor.Hide();
                Random r1 = new Random();
                Random r2 = new Random();
                pictureBox1.Left = r1.Next(1, this.Width);
                pictureBox1.Top = r2.Next(1, this.Height);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Cursor.Hide();
            Random r1 = new Random();
            Random r2 = new Random();
            pictureBox1.Left = r1.Next(1, this.Width);
            pictureBox1.Top = r2.Next(1, this.Height);
            this.Text = "بازی  :" + "تعداد کلیک ها " + Count.ToString();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            this.Text = "بازی  :" + "تعداد کلیک ها " + Count.ToString();
            Cursor.Show();
            MessageBox.Show("شما برنده شدید");
            Count = 0;
            Cursor.Hide();
            Random r1 = new Random();
            Random r2 = new Random();
            pictureBox1.Left = r1.Next(1, this.Width);
            pictureBox1.Top = r2.Next(1, this.Height);
        }
    }
}
