title: TabPage Click Events
body: <p>I'm trying to automatically trigger events based on the tab page that is clicked on the tab control.</p>
  
  <p>In design mode of my form, when I click on the tabs the properties box says Tabs System.Windows.Forms.TabControl whichever tab is selected. However, I have to click on the actual page, not the tab for the property to change to the name of the pages e.g. TaskListPage System.Windows.Forms.TabPage.</p>
  
  <p>My tabcontrol is called Tabs and I was trying to test it out using the code below which is supposed to display a message based on the tab option.</p>
  
  <pre><code> private void Tabs_SelectedIndexChanged(object sender, EventArgs e)
  
          {
              if (Tabs.SelectedTab == TaskListPage)
              {
                  MessageBox.Show("TASK LIST PAGE");
              }
              else if (Tabs.SelectedTab == SchedulePage)
              {
                  MessageBox.Show("SCHEDULE PAGE");
              }
          }
  </code></pre>
  
  <p>When I test the code above, nothing is happening.</p>
  
  <p>Any help in getting the events working when a specific tab is clicked would be greatly appreciated!</p>
  
  <p>Thankyou</p>