title: Windows Timer in a TextBox
body: <p>I am trying check if it is possible to show timer in a Textbox on click of a button. on button click the timer should start running and after the process is done I want to stop the timer. Below is what I have. What should I chnage to make it work?</p>
  
  <pre><code>public partial class MyClass: Form
  
  { 
  public MyClass()
  {
      InitializeComponent();
      InitializeTimer();      
  }
  
  private void InitializeTimer()
  {  
      this.timer1.Interval = 1000;
      this.timer1.Tick += new EventHandler(timer1_Tick);
      // don't start timer until user clicks Start            
  }
  
  private void timer1_Tick(object sender, EventArgs e)
  {
      processingMessageTextBox.Invoke(new MethodInvoker(delegate { processingMessageTextBox.Text = "show running time after click"; }));
  }       
  
  private void myButton_Click(object sender, EventArgs e)
  {
      this.timer1.Start();    
      doSomeTimeCOnsumingWork();
      this.timer1.Stop();    
  
  }        
  </code></pre>
  
  <p>}</p>
  
  <p>Please suggest.</p>