title: Progressbar value based on number of files
body: <p>I've got a progressbar in my form that I want to increase the value of in increments based on number of files in a folder. </p>
  
  <p>I guess this is pretty basic, but this kind of programming is pretty new to me.</p>
  
  <p>So I've got these lines of code:</p>
  
  <pre><code>Dim directory As New IO.DirectoryInfo("C:\Temp")
  Dim arrayFiles as IO.FileInfo() = directory.GetFiles("*.txt")
  Dim fi As IO.FileInfo
  
  For Each fi In arrayFiles
  
     Do stuff
     ProgressBar.Value = "something"
  Next
  </code></pre>
  
  <p>I'd appreciate any help at all! :)</p>
  
  <p>Edit: I got it working by doing this (probably a stupid way of doing it though)</p>
  
  <pre><code>For Each fi In arrayFiles
     ProgressBar.Value = ProgressBar.Value + arrayFiles.Length / arrayFiles.Length
  Next
  </code></pre>
  
  <p>Edit2: Come to think of it, arrayFiles.length / arrayFiles.length = 1 ..
  So i could just have typed 1 then.</p>
  
  <p>And, perhaps pretty important, I've set the ProgressBar.Maximum = arrayFiles.Length</p>