How to change the color and size of the TabControl border?

How do I change the frame size / style / color of my TabControl so that it matches the background color of my form?

I cannot find for this property in Visual Studio. Is it possible?

+4
source share
2 answers

TabControl not intended to be placed against a custom color background. What you see around the edges is the standard color used for 3D controls. You will usually not notice that if you had not changed the background color of your form. By default, they have the same color.

I do not know what a good way to fix this. TabControl does not provide many built-in options for customizing the look. You will have to draw the owner and draw it yourself.

Visit this page for some different options and sample code. I suspect the Completely OwnerDraw TabControl is what you need; Use the provided code and customize it to your liking. Be thankful that someone else has done all the work for you, because implementing this in itself is not trivial.

Also note that changing DrawMode to "OwnerDrawFixed" will disable themes. Your control will look like it came straight from Windows 95, instead of being drawn in Luna or Aero theme styles. Not a big thing if you fully customize how it is drawn, but the pain in the back, if you want, is to change the background color.

+5
source
 Me.TabPage1.BackColor = Color.Blue 

Try it, it will be useful for you.

-1
source

Source: https://habr.com/ru/post/1340782/


All Articles