title: programing vb.net, Textbox in second form will not update
body: <p>I am trying to create a timer that will countdown from the specified time. </p>
  
  <p>The user enters a time and clicks a button.<br>
  The button click opens a second form that has a timer in it.<br>
  Every time the timer ticks, the time decreases and the time left is displayed in a <em>textbox</em> on form2 (<code>textbox.text = timeLeft</code>).  </p>
  
  <p>However, the <em>textbox</em> will never actually update. It remains blank, and the only time that assigning a new value to the <code>.text</code> property will actually work is if I raise an event (for example clicking a button that will change the <code>.text</code> property of the <em>textbox</em>)</p>
  
  <p>*Here is the code for the timer class</p>
  
  <pre><code>Public Class CountdownTimer
  
  Private timeAtStart As Integer
  Private timeLeft As Integer
  
  Public Sub StartTimer(ByVal time As Integer)
      timeAtStart = time
      timeLeft = timeAtStart
      Timer1.Enabled = True
  End Sub
  
  
  Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  
      If timeLeft &gt; 0 Then
          timeLeft = timeLeft - 1
          txtTimeLeft.Text = timeLeft.ToString
  
      Else
          Timer1.Stop()
          txtTimeRemaining.Text = "Time!"
          txtTimeRemaining.ForeColor = Color.Red
      End If
  
  End Sub
  
  End Class
  </code></pre>
  
  <ul>
  <li><p>And here is how I call it:</p>
  
  <pre><code>Dim timer As New CountdownTimer
  timer.Show()
  CountdownTimer.StartTimer(CInt(txtSetTime.Text))
  </code></pre></li>
  </ul>