In winforms tabcontrols i have default tab with name start
. This tab is always opened and cant be closed! Another tabs has X
draw string for closing tab.
In my case all tabas including Start
tab has X
drawstring for closing.
I want to remove X
just on Start
tab.
Here is my code
private void mainTabControl_DrawItem(object sender, DrawItemEventArgs e)
{
//This code will render a "x" mark at the end of the Tab caption.
e.Graphics.DrawString("x", e.Font, Brushes.Black, e.Bounds.Right - CLOSE_AREA, e.Bounds.Top + 4);
e.Graphics.DrawString(this.mainTabControl.TabPages[e.Index].Text, e.Font, Brushes.Black, e.Bounds.Left + LEADING_SPACE, e.Bounds.Top + 4);
e.DrawFocusRectangle();
mainTabControl.Padding = new Point(21, 3);
}