DIGIT-ARC read-only archive · snapshot: July 23, 2026

tabclick event in C#

3 posts · originally from https://geek.digit.in/community/threads/tabclick-event-in-c.107012/

Pragadheesh
Pragadheesh Original post #1
Jan 21, 2009 at 10:49 AM
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 at 12:27 PM
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;

            }
        }