title: Guessing random radio buttons
body: <p>So far I've got the random number and radio buttons working, my specific questions is how to show the actual answer if the user guess wrong. I would show this on labelOutput in the if/else statement. Also I would like to give a hint as to the actual number before the person guess buy saying even or odd at labelHint. You can see which sections I'm working on via the comments in the code.</p>
  
  <pre><code>namespace GuessANumber
  {
  public partial class Form1 : Form
  {
      public Form1()
      {
  
          InitializeComponent();
  
          labelHint.Text = "Hover over for a hint";
  
          labelOutput.Visible = true;
  
          Init();
  
      }
  
      Random random = new Random();
  
      int correctAnswer;
  
      private void Init()
      {
          correctAnswer = random.Next(1, 6);
      }
  
      private bool UserSelectedRandomButton()
      {
          if (radioButton1.Checked == true)
              return (correctAnswer == 1);
          if (radioButton2.Checked == true)
              return (correctAnswer == 2);
          if (radioButton3.Checked == true)
              return (correctAnswer == 3);
          if (radioButton4.Checked == true)
              return (correctAnswer == 4);
          if (radioButton5.Checked == true)
              return (correctAnswer == 5);
          return false;
      }
  
  
      private void buttonSubmit_Click(object sender, EventArgs e)
      {
  
          radioButton1.Enabled = false;
          radioButton2.Enabled = false;
          radioButton3.Enabled = false;
          radioButton4.Enabled = false;
          radioButton5.Enabled = false;
  
          labelOutput.Visible = true;
  
          if (UserSelectedRandomButton() == true)
          {
              labelOutput.Text = "You are correct!";
          }
          else
          {
  
              labelOutput.Text = (" Sorry, the correct answer is" + " " + correctAnswer);//now working :)
          }
          correctAnswer = random.Next(1, 6);
      }
  
  
  
      private void labelHint_MouseEnter(object sender, EventArgs e)
      {
  
          //still working on this, if the number is odd, label changes to odd statement, if even says even statement
  
          labelHint.Text = "The number is odd";
  
  
      }
  
      private void labelHint_MouseLeave(object sender, EventArgs e)
      {
  
          labelHint.Text = "Hover over for a hint";
      }
  
  
  
  
      private void buttonReset_Click(object sender, EventArgs e)
      {
          radioButton1.Enabled = true;
          radioButton2.Enabled = true;
          radioButton3.Enabled = true;
          radioButton4.Enabled = true;
          radioButton5.Enabled = true;
  
          radioButton1.Checked = false;
          radioButton2.Checked = false;
          radioButton3.Checked = false;
          radioButton4.Checked = false;
          radioButton5.Checked = false;
  
          labelOutput.Visible = false;
  
  
  
  
      }
  
  
  
  }
  </code></pre>
  
  <p>}</p>