title: Progress bar not incrementing
body: <p>I have the following code which read a file and also increment the progress bar while reading it, but I don't see any activity in my <code>progressBar</code>. Why is this?</p>
  <pre><code>progressBar1.Minimum = 0;
  progressBar1.Maximum = (int)fileStream.Length + 1;
  progressBar1.Value = 0;
  
  using (fileStream)
  {
      fileStreamLength = (int)fileStream.Length + 1;
      fileInBytes = new byte[fileStreamLength];
      int currbyte = 0, i = 0;
      var a = 0;
      while (currbyte != -1)
      {
          currbyte = fileStream.ReadByte();
          fileInBytes[i++] = (byte)currbyte;
          progressBar1.Value=i;
  
      }
  
   }
  </code></pre>