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 CafeNet_Timer
{
    public partial class Main : Form
    {

        private TimerCP[] _TimerCP = new TimerCP[5];
        

        public Main()
        {
            InitializeComponent();

            int loc = 30;
            for (int x = 0; x < 5; x++)
            {
                _TimerCP[x] = new TimerCP();
                _TimerCP[x].Location = new System.Drawing.Point(20, loc);
                grpShow.Controls.Add(_TimerCP[x]);
                loc += 130;
            }


            ActiveControl = textBox1;
        }

        private void Main_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (MessageBox.Show("آیا شما مطمئن هستید که میخواهید این برنامه را ببندید؟", "خروج از برنامه", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, MessageBoxOptions.RightAlign) == DialogResult.Yes)
            {
            }
            else
            {
                e.Cancel = true;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Clear();
            textBox1.Focus(); 
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox2.Clear();
            textBox2.Focus(); 
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox3.Clear();
            textBox3.Focus(); 
        }

        private void button4_Click(object sender, EventArgs e)
        {
            textBox4.Clear();
            textBox4.Focus(); 
        }

        private void button5_Click(object sender, EventArgs e)
        {
            textBox5.Clear();
            textBox5.Focus(); 
        }

      

        
    }
}
