tabclick event in C#

Status
Not open for further replies.

Pragadheesh

In the zone
hi,
how to add a tabclick event in C#.? i.e on clicking the tab button i need to generate an event.,

like if i have 3tabs, India, US and UK, clicking the tabs i should get an appropriate message box or something.
 

ruturaj3

Journeyman
Add Tabcontrol on form, then select events from properties window.

Code:
 private void tabControl1_Click(object sender, EventArgs e)
        {
            switch(tabControl1.SelectedIndex)
            {
                case 0:
                MessageBox.Show("India");
                break;

                case 1:
                MessageBox.Show("US");
                break;

                case 2:
                MessageBox.Show("UK");
                break;

            }
        }
 
Status
Not open for further replies.
Top Bottom