title: C# show timer in textbox
body: <p>I'm trying to make a timer run in a textbox and I haven't had any luck.</p>
  
  <p>This is the code I'm using:</p>
  
  <pre><code>private static System.Timers.Timer timer;
  ...
  private void StartBtn_Click(object sender, EventArgs e)
  {
      timer = new System.Timers.Timer(1000);
      timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
      timer.Enabled = true;
  }
  ...
  private void OnTimedEvent(object source, ElapsedEventArgs e)
  {
      TimeTb.Text = e.SignalTime.ToString();
  }
  </code></pre>
  
  <p>But nothing happens.</p>
  
  <p>I tried this:</p>
  
  <pre><code>private void OnTimedEvent(object source, ElapsedEventArgs e)
  {
      MessageBox.Show(e.SignalTime.ToString(), 
      "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
  }
  </code></pre>
  
  <p>And it worked fine. Anyone know why it isn't working with my textbox?</p>