eekj
asked on
TabPage Color
Hi,
I need to change the backcolor of a TabControl (not the individual TabPages). How should I do this? Any code/links appreciated!
Edit: More specifically, I just want to change the colour behind the TabPage Tabs, so it doesn't look awkward after Ive changed the color of the TabPages themselves.
I need to change the backcolor of a TabControl (not the individual TabPages). How should I do this? Any code/links appreciated!
Edit: More specifically, I just want to change the colour behind the TabPage Tabs, so it doesn't look awkward after Ive changed the color of the TabPages themselves.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i imagine you've already checked out the tabcontrol.backcolor property?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Lacutah,
This was great, here is the c# code for the same thing...
This was great, here is the c# code for the same thing...
private void tabControl_DrawItem(object sender, DrawItemEventArgs e)
{
// This draws the background.
e.Graphics.FillRectangle(Brushes.Black, e.Bounds);
// Get the correct text to draw from the text property of the page
// that you're drawing for
string txtStr = tabControl.TabPages[e.Index].Text;
// Draw the string, in this case, I made the text White,
// and the +3 merely offsets the text from the upper left corner of the tab.
e.Graphics.DrawString(txtStr, tabControl.Font, Brushes.White, e.Bounds.X + 3, e.Bounds.Y + 3);
}