Set Blackgroud color Tab Control in Windows form
//control tab header color this.tabControl2.DrawMode = TabDrawMode.OwnerDrawFixed; this.tabControl2.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControl2_DrawItem);
TabPage page = tabControl2.TabPages[e.Index]; //Color col = e.Index == 0 ? Color.LightGreen : Color.Transparent; if (e.Index == 0) { e.Graphics.FillRectangle(new SolidBrush(Color.LightGreen), e.Bounds); } else if (e.Index == 1) { e.Graphics.FillRectangle(new SolidBrush(Color.Bisque), e.Bounds); } Rectangle paddedBounds = e.Bounds; int yOffset = (e.State == DrawItemState.Selected) ? -2 : 1; paddedBounds.Offset(1, yOffset); TextRenderer.DrawText(e.Graphics, page.Text,Font, paddedBounds, page.ForeColor);