0

what i have done is copied answer in label and now matching the radiobutton option with it so far so good but i dont know how to uncheck radio button when i get to next question and method of mine stucks in between like sometime it just donot match the answer at all my code is below,. any other method that can help needed thanx

 if (radioButton1.Checked)
            {

                if (labelanswer.Text == radioButton1.Text.Trim())
                {

                    MessageBox.Show("right");

                    score = +score + 1;
                    labs.Text = score.ToString();

                }
                else if

                     (radioButton2.Checked)
                {

                    if (labelanswer.Text == radioButton2.Text.Trim())
                    {

                        MessageBox.Show("right");

                        score = +score + 1;
                        labs.Text = score.ToString();

                    }

                }
                else if

                    (radioButton3.Checked)
                {

                    if (labelanswer.Text == radioButton3.Text.Trim())
                    {

                        MessageBox.Show("right");

                        score = +score + 1;
                        labs.Text = score.ToString();

                    }
                    else if

                    (radioButton4.Checked)
                    {

                        if (labelanswer.Text == radioButton4.Text.Trim())
                        {

                            MessageBox.Show("right");

                            score = +score + 1;
                            labs.Text = score.ToString();

                        }

                    }

Edited by Stella_3: spell mistake

3
Contributors
4
Replies
14
Views
3 Months
Discussion Span
Last Post by ddanbe
1

Yes, perhaps something like this:

A question
1.answer 1
2.answer 2
3.answer 3

Then in a textbox let the user answer 1,2 or 3, process this answer further.

Edited by ddanbe: typo

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.