private void reloadElementAnswer()
        {
            ObjectAnswersClass objectA = new ObjectAnswersClass();

            //////////////////////1//////////////////////////
            objectA.checkBox  = checkBox1;
            objectA.textBox   = textBox2;
            objectA.delButton = button7;
            objectAnswers.Add(objectA);
            //////////////////////2//////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox2;
            objectA.textBox   = textBox3;
            objectA.delButton = button8;
            objectAnswers.Add(objectA);
            //////////////////////3//////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox3;
            objectA.textBox   = textBox4;
            objectA.delButton = button9;
            objectAnswers.Add(objectA);
            ///////////////////////4/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox4;
            objectA.textBox   = textBox5;
            objectA.delButton = button10;
            objectAnswers.Add(objectA);
            ///////////////////////5/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox5;
            objectA.textBox   = textBox6;
            objectA.delButton = button11;
            objectAnswers.Add(objectA);
            ///////////////////////6/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox6;
            objectA.textBox   = textBox7;
            objectA.delButton = button12;
            objectAnswers.Add(objectA);
            ///////////////////////7/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox7;
            objectA.textBox   = textBox8;
            objectA.delButton = button13;
            objectAnswers.Add(objectA);
            ///////////////////////8/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox8;
            objectA.textBox   = textBox9;
            objectA.delButton = button14;
            objectAnswers.Add(objectA);
            ///////////////////////9/////////////////////////
            objectA           = new ObjectAnswersClass();
            objectA.checkBox  = checkBox9;
            objectA.textBox   = textBox10;
            objectA.delButton = button15;
            objectAnswers.Add(objectA);
        }
Пример #2
0
        private ObjectAnswersClass findBlock(String nameButton)
        {
            ObjectAnswersClass resultObject = new ObjectAnswersClass();

            ((TabPageClass)tabControl1.SelectedTab).objectAnswers.ForEach(delegate(ObjectAnswersClass objectA)
            {
                if (objectA.delButton.Name.Equals(nameButton))
                {
                    resultObject = objectA;
                }
            });
            return(resultObject);
        }
Пример #3
0
 public void deleteButton_Click(object sender, EventArgs e)
 {
     try
     {
         Button             button = (Button)sender;
         ObjectAnswersClass answer = findBlock(button.Name);
         answer.checkBox.Visible  = false;
         answer.textBox.Visible   = false;
         answer.textBox.Text      = "";
         answer.delButton.Visible = false;
         if (button.Tag != null)
         {
             idDelAnswer.Add((int)button.Tag);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception.Message);
     }
 }