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

namespace MyCSharpProject
{
    public partial class MyPlayerControl : UserControl
    {
        public MyPlayerControl()
        {
            InitializeComponent();
          
        }

        /// <summary>
        /// PROPERTY FOR THE PLAYERNAME
        /// </summary>
        new public string Text
        {
            get { return label5.Text; }
            set { label5.Text = value; }
        }

        /// <summary>
        /// ENABLES SECOND COMBOBOX AFTER SELECTING A CATEGORY IN THE FIRST COMBOBOX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox1.Enabled = false;
            foreach (var item in comboBox1.Items)
            {
                if(item != comboBox1.SelectedItem)
                    comboBox2.Items.Add(item);
                    
            }

            comboBox2.Enabled = true;
            
        }

        /// <summary>
        /// ENABLES THIRD COMBOBOX AFTER SELECTING A CATEGORY IN THE SECOND COMBOBOX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox2.Enabled = false;
            foreach (var item in comboBox2.Items)
            {
                if (item != comboBox2.SelectedItem)
                    comboBox3.Items.Add(item);

            }
            comboBox3.Enabled = true;
        }
                
        /// <summary>
        /// ENABLES FOURTH COMBOBOX AFTER SELECTING A CATEGORY IN THIRD COMBOBOX
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            comboBox3.Enabled = false;
            foreach (var item in comboBox3.Items)
            {
                if (item != comboBox3.SelectedItem)
                    comboBox4.Items.Add(item);

            }
            comboBox4.SelectedIndex = 0;
           
        }
        

        
        
    }
}
