title: What does "An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll" Mean?
body: <p>Whenever My form 1 tries to open form 2 I get this error...</p>
  
  <pre><code>An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
  
  Additional information: Input string was not in a correct format.
  </code></pre>
  
  <p>What does this mean? Here is the Code I use for opening Form2...</p>
  
  <pre><code>if (TimerValue == 5000)
           {
               this -&gt; timer1 -&gt; Stop();
               TimerValue = 0;
               Form2 ^ f2 = gcnew Form2;
               f2-&gt;Show();
               MoviePlay = 1;
               StreamWriter^ outFile = gcnew StreamWriter("Movie.txt");
               String^ Movie = MoviePlay.ToString();
               outFile-&gt;Write(Movie);
               outFile-&gt;Close();
               this -&gt; button4 -&gt;Visible = false;
               this -&gt; button5 -&gt;Visible = false;
               this -&gt; label2 -&gt;Visible = false;
               this -&gt; button2 -&gt;Visible = false;
               this -&gt; button3 -&gt;Visible = false;
               FriendString = File::ReadAllText(".\\Rca13\\Friend.txt");
               Friend = System::Convert::ToInt32(FriendString);
               if (Friend == 1)
               {
               this -&gt; pictureBox1 -&gt; Load("RetaliationBackground1_Pony1");
               }
               if (Friend == 2)
               {
               this -&gt; pictureBox1 -&gt; Load("RetaliationBackground1_Pony2");
               }
               if (Friend == 3)
               {
               this -&gt; pictureBox1 -&gt; Load("RetaliationBackground1_Pony3");
               }
               if (Friend == 4)
               {
               this -&gt; pictureBox1 -&gt; Load("RetaliationBackground1_SwagMasta");
               }
  
           }
  </code></pre>
  
  <p>Is there anything that was put into this code causing the errors?</p>