<p>If you use the standard tab control in .NET for your tab pages and you try to change the look and feel a little bit then you are able to change the back color of the tab pages but not for the tab control. The property is available, you could set it but it has no effect. If you change the back color of the pages and not of the tab control it looks... uhm quite ugly.</p>

<p>I know Microsoft doesn't want it to be set. <a href="http://msdn.microsoft.com/en/library/w4sc610z(VS.80).aspx" rel="nofollow noreferrer">MSDN</a>: '<i>This property supports the .NET Framework infrastructure and is not intended to be used directly from your code. This member is not meaningful for this control.</i>' A control property just for color which supports the .NET infrastructure? ...hard to believe.</p>

<p>I hoped over the years Microsoft would change it but they did not. I created my own TabControl class which overrides the paint method to fix this. But is this really the best solution?</p>

<p>What is the reason for not supporting BackColor for this control? What is your solution to fix this? Is there a better solution than overriding the paint method?</p>

[{'answer_id': 214082, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>The background color of the tab seems to be controlled by the OS's Display Properties.  Specifically the under the appearance tab, Windows and buttons property (Windows XP).  When set to Windows Classic style, the tab doesn't change color ever.  When set to Windows XP style, it at least changes from gray to white when selected.  So not being able to control the background color is a feature!</p>\n"}, {'answer_id': 268271, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': "<p>The solution in Rajesh's blog is really useful, but it colours the tab part of the control only. In my case I had a tabcontrol on a different coloured background. The tabs themselves were grey which wasn't a problem, but the area to the right of the tabs was displaying as a grey strip. </p>\n\n<p>To change this colour to the colour of your background you need to add the following code to the DrawItem method (as described in Rajesh's solution). I'm using VB.Net:</p>\n\n<pre><code>...\n\nDim r As Rectangle = tabControl1.GetTabRect(tabControl1.TabPages.Count-1)\nDim rf As RectangleF = New RectangleF(r.X + r.Width, r.Y - 5, tabControl1.Width - (r.X + r.Width), r.Height + 5)\nDim b As Brush = New SolidBrush(Color.White)\ne.Graphics.FillRectangle(b, rf)\n\n...\n</code></pre>\n\n<p>Basically you need to get the rectangle made of the right hand side of the last tab to the right hand side of the tab control and then fill it to your desired colour.</p>\n"}, {'answer_id': 810250, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>Thanks, LauraM.  You helped get me on the right track.  I had already found the link Oskar provided but that didn\'t do anything for the strip at the end.</p>\n\n<p>In the end, I had to change quite a bit because I needed a background image on the form to bleed through or if the parent was something without a background image, the backcolor.  I also needed icons to show if they were present.  I have a full write-up with all the code in my <a href="http://blog.villainousmind.com/2009/04/fix-backcolor-for-tabcontrol-in-net.html" rel="nofollow noreferrer">TabControl BackColor fix post</a>.</p>\n'}]
['https://Stackoverflow.com/questions/67300', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9470/']