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.
Locked
User avatar
jimbobukii
Posts: 52
Joined: Mon Jan 14, 2013 10:34 pm

TabControl Changing colour (Color)

Post by jimbobukii » Thu Mar 28, 2013 9:11 am

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: 5839
Joined: Thu Aug 18, 2011 4:56 am

Re: TabControl Changing colour (Color)

Post by davidc » Thu Mar 28, 2013 9:35 am

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.

Locked