TabControl

Displays multiple tab pages. Each tab page contains other controls. Finally a tab page is a container for the other controls; A tab control is a container of multiple tab pages.

API: System.Windows.Forms.TabControl
Naming Convension: tbCtrlxxxxxx
Properties of TabControl
Property Description
TabPages Contains the list of tab pages.
Alignment Top, Bottom, Left, Right
Name, BackColor, ForeColor, Enabled, Visible, Size, Location, ContextMenuStrip, BackgroundImage, BackgroundImageLayout


Events of TabControl

Event Description
SelectedIndexChanged, Click, DoubleClick, MouseMove, MouseEnter, MouseLeave, KeyPress, Enter, Leave

Demo on TabControl

private void btnAdd_Click(object sender, EventArgs e)
{
int n1, n2, n3;
n1 = Convert.ToInt32(txtFirstValue.Text);
n2 = Convert.ToInt32(txtSecondValue.Text);
n3 = n1 + n2;
txtResult.Text = Convert.ToString(n3);
}
private void btnMultiply_Click(object sender, EventArgs e)
{
int n1, n2, n3;
n1 = Convert.ToInt32(txtFirstValue.Text);
n2 = Convert.ToInt32(txtSecondValue.Text);
n3 = n1 * n2;
txtResult.Text = Convert.ToString(n3);
}