Switch from one tab to other programatically
<p>In a <code>Windows Form</code>, while using tabControl1 how to switch from one tab to other(i.e tabPage1 to tabPage2) on button click in tabPage1..Tried a lot with </p>

<pre><code>tabPage2.Show(); 
tabControl1.SelectedIndex = tabPage2; 
</code></pre>

<p>etc but not giving any o/p...Please help</p>
