How can I change the border color and size of a TabControl?
The TabControl
isn't expecting to be placed over a custom-colored background. What you're seeing at the edges is the standard color used for 3D controls. You normally wouldn't notice that if you hadn't changed the background color of your form. By default, they're the same color.
I don't know of any good way to fix this. The TabControl
doesn't expose an awful lot of built-in options for customizing its appearance. You're going to have to owner draw and paint it a custom color yourself.
Visit this page for some different options and sample code. I suspect that the Completely OwnerDraw TabControl is what you need; use the code that's provided and customize it to your liking. Be thankful someone else has already done all the work for you, because implementing this yourself is non-trivial.
Also note that changing the DrawMode
to "OwnerDrawFixed" will disable themes. Your control will look like it came straight out of Windows 95, instead of getting drawn in the Luna or Aero theme styles. Not a big deal if you're completely customizing how it's painted, but a pain in the rear if all you want is to change the background color.