private void buttonSubmit_Click(object sender, EventArgs e)
        {
            int CheckedBoxes = 0;

            for (int i = 0; i < CbArr.Length; i++)
            {
                if (CbArr[i].Checked)
                {
                    CheckedBoxes++;
                    //MessageBox.Show(CheckedBoxes.ToString() + " CheckedBoxes");
                }
            }
            String[] RecType = new String[LABEL_AMOUNT];
            for (int i = 0; i < LABEL_AMOUNT; i++)
            {
                if (CbArr[i].Checked)
                {
                    RecType[i] = labelArr[i].Text;
                    //MessageBox.Show(RecType[i]);
                }
                else
                {
                    //MessageBox.Show("NIL");
                    RecType[i] = "NIL";
                }
            }
            cEvent.SetRecurringType(RecType);

            AddEvent.SetEvent(cEvent);

            this.Dispose();
        }
        private void SquareHandler(object sender, EventArgs e)
        {
            AddEvent form;

            if (sender is Label)
            {
                Label p = ((Label)sender);
                foreach (CalSquare sq in squares)
                {
                    if (sq.GetLabel1().Equals(p) ||
                        sq.GetLabel2().Equals(p) ||
                        sq.GetDayLabel().Equals(p))
                    {
                        //MessageBox.Show("Suc)");
                        form = new AddEvent(this, sq.GetDate());
                        form.ShowDialog();

                        break;
                    }
                }
            }
            if (sender is DoubleBufferedTableLayoutPanel)
            {
                var p = ((DoubleBufferedTableLayoutPanel)sender);
                foreach (CalSquare sq in squares)
                {
                    if (sq.GetSquare().Equals(p))
                    {
                        form = new AddEvent(this, sq.GetDate());
                        form.ShowDialog();

                        break;
                    }
                }
            }
            //else //MessageBox.Show("Didnt recognice the obj" + sender.ToString());
        }
 public ContactsForm(AddEvent addEvent)
 {
     this.addEvent = addEvent;
     InitializeComponent();
 }