TabControl Left Alignment

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 1 year and 6 months 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
travisc
Posts: 9
Last visit: Thu Oct 12, 2023 12:20 pm

TabControl Left Alignment

Post by travisc »

So I'm working on a new project and trying to use the tab control as a way to move from one process to another. The problem is when i have the tab alignment set to top or bottom the color matches the form color, but when i change the alignment to left or right, it defaults to the control color. On another test script i am using the DrawItem to change the color of the tabs, which works great. But Is there a way to change this color on the tab control when the alignment is set to right or left.
Tab-Matching Form color.PNG
Tab-Matching Form color.PNG (5.72 KiB) Viewed 851 times

Tab-Not Matching Form color.PNG
Tab-Not Matching Form color.PNG (10.86 KiB) Viewed 851 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: TabControl Left Alignment

Post by jvierra »

It appears that you will have to draw the background to match the forms background. I believe this is an old issue with the tab control.
travisc
Posts: 9
Last visit: Thu Oct 12, 2023 12:20 pm

Re: TabControl Left Alignment

Post by travisc »

Does anyone have a code example to do this? Right now i have the code to change the tab colors, but cant figure out how to change the background of the tab control itself. When i try to just use the $tabcontrol1.BackColor, but it doesnt take. i think its a read only property.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: TabControl Left Alignment

Post by jvierra »

The BackColor does not change the tab control color it changes the client area.
This topic is 1 year and 6 months 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