title: C# - Timer.Stop() isn't working
body: <p>I make a call via client side to initiate the StopTickerTimer function which successfully calls the StopTickerTimer function but unfortunately doesn't actually stop the timer. The timer starts and works properly but I can't seem to understand why my timer isn't stopping. I've tried setting timer.Enabled = false. I've tried various solutions that I've found on here but nothing seems to work.</p>
  
  <pre><code>    public Timer timer = new Timer();
      private string jsonContents;
      private string currentTickerPlaylist;
      private int i = 0;
      private List&lt;string&gt; playlistTickers;
  
      public void StartTickerTimer(int seconds, string selectedPlaylist)
      {
          currentTickerPlaylist = selectedPlaylist;
          InitPlaylistTickerTimer(seconds);            
      }
  
      public void StopTickerTimer()
      {
          StopTimer();
      }
  
      private void InitPlaylistTickerTimer(int seconds)
      {
          timer.Elapsed += new ElapsedEventHandler(t_Tick);
          timer.Interval = seconds * 1000;
          timer.AutoReset = true;
          timer.Start();
      }
  
      private void StopTimer()
      {
          timer.Stop();
      }
  
      private void t_Tick(object sender, EventArgs e)
      {
  
          SetPlaylistTickerSettings();
          if (i &gt;= playlistTickers.Count)
          {
              i = 0;
              Payload ticker = new Payload
              {
                  ticker = playlistTickers[i]
              };
              Payload ticker2 = new Payload
              {
                  payload = ticker
              };
              var json = ServiceStack.Text.JsonSerializer.SerializeToString(ticker2);
              PutToSingular("url", json);
              i++;
          }
          else
          {
              Payload ticker = new Payload
              {
                  ticker = playlistTickers[i]
              };
              Payload ticker2 = new Payload
              {
                  payload = ticker
              };
              var json = ServiceStack.Text.JsonSerializer.SerializeToString(ticker2);
              PutToSingular("url", json);
              i++;
          }
  
      }
  </code></pre>