title: Where should I place this if statement so that it executes when each of the buttons is clicked?
body: <p>I am programming a Rock Paper Scissors windows forms game with an option to play against the computer or another player using the keyboard arrows.
  The form is not yet finished, since it will have some pictures on the pictures boxes according to the user's play.</p>
  
  <p>When checkbox1 is checked it looks like this:
  <a href="https://i.stack.imgur.com/511XW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/511XW.png" alt="enter image description here"></a></p>
  
  <p>When checkbox2 is checked it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/1sPfT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1sPfT.png" alt="enter image description here"></a></p>
  
  <p>I have already written functions <code>computer_choice</code> and <code>Check_Winner</code> which return the random computer choice and winner of each round, respectively.
  And when someone clicks on the button with the option, choice1 is set to the option the button corresponds to.
  Then I wrote this code put I don't know where to place it. Because I want the program to present the winner and each of the choices only when both players have played. Basically I want a practical way for this to execute when one of the icons on the screen has been clicked and the player two has pressed one of the arrows as well. Basically when <code>choice1</code> and <code>choice2</code> are both different than null and equal to one of the three choices. I have already wrote something like <code>choice1 = "Rock";</code> on the Rock_click function.
  In addition, I want to know if it's a good idea to add this function to class1 and if so, how should I do it so that I can use the form1 variables.</p>
  
  <p>I wrote something like this but I don't know how to use it so that it takes into consideration the events I just mentioned.</p>
  
  <pre><code>if (checkBox1.Checked &amp;&amp; choice1 != null)
  {
      string choice2 = class1.computer_choice();
  
      MessageBox.Show("Winner is " + class1.Check_Winner(choice1, chocie2);
      MessageBox.Show("Player one chose " + choice1 + " and computer chose " + choice2);
      choice1= null;
  }
  else if (checkBox2.Checked &amp;&amp; choice2 != null &amp;&amp; choice1 != null)
  {
      MessageBox.Show("Winner is " + class1.Check_Winner(choice1, choice2 ));
      MessageBox.Show("Player one chose " + choice1+ "and player two chose " + choice2);
      choice1 = choice2 null;
  }
  </code></pre>