title: End a else if statement C#
body: <p>I didn't know what else to use in this case but an if statement.</p>
  
  <p>What I am trying to do is I am getting a value <code>string direction;</code> from a Windows form and checking if it has the value I am looking for. Then checking if the <code>turtleDir</code> which is a string value indicating the direction <code>turtleDir</code> has. </p>
  
  <p>The problem comes here at else if statements, when the <code>turtleDir</code> is <code>lookingleft</code> it does all of the else if statements. What I want it to do is after it has done that else if statement it needs to stop and wait for the next command. not go through all the statements. </p>
  
  <p>Can someone please advise me on how to fix it and what I am doing wrong?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>else if ( Program.form.direction == "right" ) 
  {
     if ( turtleDir == "left" )
     {
        angle = -1.6f;
        turtleDir = "lookingLeft";
        Program.form.direction = "";
     }
     else if ( turtleDir == "lookingLeft" )
     {
        angle = 3.15f;
        turtleDir = "lookingDown";
     }
     else if ( turtleDir == "lookingDown" )
     {
        angle = 1.6f;
        turtleDir = "lookingRight";
     }
     else if ( turtleDir == "lookingRight" )
     {
        angle = 0.0f;
        turtleDir = "lookingUp";   
     }
  }
  </code></pre>