title: how to execute code when the tab index changes?
body: <p>I currently have a tabcontrol on my windows form in visual studio, i would like it so that when the user clicks on a different tab that i can execute some code (for example populate a listbox). </p>
  
  <p>when i double click on the tab it only brings up an onclick event for the body of the tabcontrol. </p>
  
  <p>i was thinking that i may have to create a thread in the form load that will constantly check whether the tab index changes and if it does then execute some code. but surely there must be an easier way?</p>