# tabclick event in C#



## Pragadheesh (Jan 21, 2009)

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 (Jan 21, 2009)

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


```
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;

            }
        }
```


----------



## Pragadheesh (Jan 21, 2009)

thanks a lot.


----------

