title: VB.net Cross-Thread
body: <p>I have a cmd command that needs to be executed, when the command starts it starts to fill a progressbar. When the cmd command is done the progressbar needs to fill up to 100.</p>
  
  <p>This is the code i use, but it gives me an error when the progressbar.Value = 100 comes up.    </p>
  
  <pre><code>Public Class Form1
      Dim teller As Integer
  
  Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerProgressbar.Tick
      teller += 1
      ProgressBar1.Value = teller
  
      If ProgressBar1.Value = ProgressBar1.Maximum Then
          TimerProgressbar.Stop()
      End If
  End Sub
  </code></pre>
  
  <p>This are the tow commands in another private sub where the app is crashing on</p>
  
  <pre><code>ProgressBar1.Value = 100
      TimerProgressbar.Stop()
  </code></pre>
  
  <p>When i debug it and i try it out it crashes on </p>
  
  <pre><code>ProgressBar1.Value = 100
  </code></pre>
  
  <p>But when i build it under Windows 7 it runs fine without crashing, however a few people reported me it crashes on there Windows xp system.</p>
  
  <p>VB gives me a suggestions about Cross Thread, but i don't know how i could make it work with this.</p>