The Rajesh blog solution is really useful, but it only colors the control tab. In my case, I had a tabcontrol on a different colored background. The tabs themselves were gray, which was not a problem, but the area to the right of the tabs was displayed as a gray bar.
To change this color to the background color, you need to add the following code to the DrawItem method (as described in the Rajesh solution). I am using VB.Net:
... Dim r As Rectangle = tabControl1.GetTabRect(tabControl1.TabPages.Count-1) Dim rf As RectangleF = New RectangleF(rX + r.Width, rY - 5, tabControl1.Width - (rX + r.Width), r.Height + 5) Dim b As Brush = New SolidBrush(Color.White) e.Graphics.FillRectangle(b, rf) ...
Basically, you need to get a rectangle made on the right side of the last tab, on the right side of the tab control, and then fill it to the desired color.
Lauram
source share