Windows Forms TabControl BackColor VS 2005

How can I set the backcolor of the TabControl container to Transparent?

Even with padding set to 0, the tabs have a couple of pixels of gray system color to the right or top of the tab itself. Since I have the tab sitting on a form with a gradient, these artifacts are really visible and look ugly.

Can someone tell me how to solve this problem?

Thanks in advance,
Kevin McElhiney
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Roshan DavisConnect With a Mentor Commented:
WndProc is only needed if you need the event SelectedIndexChanging. Can you try to comment out the WndProc and see that is this the right transparent control you needed?
if yes, we can make changes to make it work.
KMcElhineyAuthor Commented:

I'm working in Framework 2.0.  This code appears to use C# 3.0 constructs, e.g. the "op_Implicit" method.

Any idea how to convert it to 2.0 code?


Never miss a deadline with

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Roshan DavisCommented:
lloks like that class mainly using Windows Messages and programming. Shouldn't make much difference in the old framework. Could you please tell me where exactly are you getting error?
KMcElhineyAuthor Commented:

I created a little test project and copied the code for the overridden TabControl class.

I fixed the problem with the use of "op_Implicit" by changing the code to read:

new RectangleF(new PointF(0.0F, 0.0F), r.Size)

Now I'm getting a null reference exception In the overridden WndProc function:

SelectedIndexChanging(this, e);

This generates a null reference exception.

You will probably have to create a test project to see this problem.

KMcElhineyAuthor Commented:
Typical Roshmon answer, not much explanation. I just want to close this and move on.
All Courses

From novice to tech pro — start learning today.