title: C# Removing a timer after adding it with Timer.Elapsed
body: <p>I have a little problem here. For now I'm starting one timer at the start of application using this:</p>
  
  <pre><code>if (Initialized == 0)
  {
      errorCheckTimer.Elapsed += (sender, e) =&gt; OnErrorCheckTimerElapsed(sender, e);
      Initialized = 1;
  }
  </code></pre>
  
  <p>It makes sure it's started only one time. If I were to execute this line more than once, the timer would fire multiple times and once.</p>
  
  <p>Now after initializing the timer, I occassionally run it using:</p>
  
  <pre><code>errorCheckTimer.Interval = ErrorTimerInterval;
  errorCheckTimer.Enabled = true;
  errorCheckTimer.Start();
  </code></pre>
  
  <p>And after certain actions happen, I stop it with:</p>
  
  <pre><code>tradeErrorTimer.Enabled = false;
  tradeErrorTimer.Stop();
  </code></pre>
  
  <p>But there is some obscure glitch happening. The timer always works when its firstly initialized, but sometimes will not turn on at all, and the OnErrorCheckTimerElapsed will not get executed.</p>
  
  <p>Therefore to make it more reilable, can I remove the timer that has been added into OnErrorCheckTimerElapsed.Elapsed to initialize a new one every time I need to start it?</p>
  
  <p>If I try to initialize them multiple times, I get the OnErrorCheckTimerElapsed firing multiple times at once.</p>
  
  <p>Thank you.</p>