TabControl Changing colour (Color)

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
jimbobukii
Posts: 52
Last visit: Mon Dec 04, 2017 9:59 am

TabControl Changing colour (Color)

Post by jimbobukii »

I have been looking around for a little while but cannot seem to find the answer

I am creating a form which has white as a background. I have a number of tabs within a tabcontrol and want to try and make the tabs are part of the background..

All I want is white tabs on a white background with Black tab text. no selected tab border etc.

I have had a look at Spotlight on the TabControl but there doesn't seem to be any information

Thank you in advance
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: TabControl Changing colour (Color)

Post by davidc »

In order to do this you will have to use custom paint code and set the DrawMode property to OwnerDrawFixed.

Please refer to MSDN for more information:

http://msdn.microsoft.com/en-us/library ... wMode.aspx

You will also need to respond to the DrawItem event:

http://msdn.microsoft.com/en-us/library ... wItem.aspx

David
David
SAPIEN Technologies, Inc.
This topic is 11 years old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked