title: How to find which tab page (TabControl) is on
body: <p>What is the easyest way to find which tab is on. I want to show some data when i click on tabpage2 or some other tabpage. I did it like this but is not good solution:</p>
  
  <pre><code>private int findTabPage { get; set; }
      private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
      {
          if (tabControl1.SelectedTab == tabPage1)
              findTabPage = 1;
          if (tabControl1.SelectedTab == tabPage2)
              findTabPage = 2;
      }
  </code></pre>
  
  <p>and for displaying data:</p>
  
  <pre><code> if (findTabPage == 1)
       { some code here }
   if (findTabPage == 2)
       { some code here }
  </code></pre>
  
  <p>Is there any other solution for example like this?</p>