Click here to Skip to main content
15,888,579 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I change tab control back color. It is highlighted on image.

https://drive.google.com/open?id=0B2RsqtI-JTVxcHJEdnZJUjZpQzQ&authuser=0[^]

I have a code for changing tab color, maybe it will help.

private void TabControl_DrawItem(object sender, DrawItemEventArgs e)
{
switch (e.Index)
{
case 0:
e.Graphics.FillRectangle(new SolidBrush(Color.Violet), e.Bounds);
break;
case 1:
e.Graphics.FillRectangle(new SolidBrush(Color.Blue), e.Bounds);
break;
}
Rectangle PaddedBounds = e.Bounds;
PaddedBounds.Inflate(-2,-2);
e.Graphics.DrawString(TabControl.TabPages[e.Index].Text, this.Font, SystemBrushes.HighlightText, PaddedBounds);
}
Posted
Updated 10-May-15 5:48am
v2
Comments
morris “mason” bonham 10-May-15 11:48am    
And it always cuts one letter in tab name (text).

I have tried both already. Non of them helped!

I just changed its mode to standard tabs. In this mode that bar is white!
 
Share this answer
 
Please see this link

http://stackoverflow.com/questions/5338587/set-tabpage-header-color[^]
everything explain here

Cheer!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900