コード例 #1
0
        private void Next_Button(object sender, EventArgs e)
        {
            if (label_ErrorMassage.Visible)
            {
                label_ErrorMassage.Visible = false;
            }

            if (!answer1.Checked && !answer2.Checked && !answer3.Checked && !answer4.Checked)
            {
                label_ErrorMassage.Visible = true;
                return;
            }
            else
            {
                label_ErrorMassage.Visible = false;
            }

            //else if (parametr != imagePathes.Count)
            //{
            RadioButton[] answerButtons = { answer1, answer2, answer3, answer4 };

            if (answerButtons[positionOfTrueAnswer].Checked)
            {
                counterOfTrueAnswers++;
            }

            if (parametr != imagePathes.Count)
            {
                Methods.ShowBinaryCodeInLabel(label_BinaryXYZ, trueAnswers[parametr].Length);
                Methods.ShowProgressInLabel(label_Progress, parametr, trueAnswers.Count);
                Methods.GenerateFalseAnswers(answerButtons,
                                             trueAnswers[parametr], numAnswers, out positionOfTrueAnswer);

                imageWithTask.Image = Image.FromFile(imagePathes[parametr]);

                parametr++;
            }
            //}
            else
            {
                var resultForm = new UserDataForm(this);
                this.Hide();
                resultForm.Show();
                //resultForm.label10.Text = counterOfTrueAnswers.ToString();
                //resultForm.label7.Text = this.label4.Text;
                //resultForm.label8.Text = this.label5.Text;
                //resultForm.label9.Text = this.label6.Text;
                parametr = 0;
            }
        }
コード例 #2
0
ファイル: ResultForm.cs プロジェクト: MikhailKnysh/CourseWork
 public ResultForm(UserDataForm testForm) => InitializeComponent();