title: Visual Studio 2010 status bar in C++/CLI
body: <p>In VS 2010 I'm trying to read a text file on button click and set that value as the status button value. The text file will always contain a single line with a number between 0 and 100. I'm trying to do this in C++/CLI because I'm familiar with C++ but this seems like a whole different lang! This is what I have but it causes the GUI to crash. I know it's the loops fault but I don't know why, what's the best (noob) way to approach this?</p>
  
  <pre><code>    while (result&lt;100)
      {
              StreamReader ^read=gcnew StreamReader("Status.txt");                    
              String ^x=read-&gt;ReadLine();
              read-&gt;Close();
              Int32::TryParse(x, result);
              progressBar1-&gt;Value= result;    
      }
  </code></pre>