Skip to content

TabPage DarkMode renders tabs and tab background incorrectly and different in .Net 9 and 10 #13675

@paul1956

Description

@paul1956

.NET version

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.14.7 Preview 1.0

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

N/A

Issue description

It is unclear how to get TabPage to correctly render in DarkMode in both .Net 9 and .Net 10.

The designer does not support DarkMode (by design?) so it's difficult to know how it should be setup.

With TabPage1.UseVisualStyleBackColor = True, Tab Background is Dark but the page background is white
Image

With TabPage1.UseVisualStyleBackColor = False, Tab Background is Dark and the page background is dark
Image

If I render the Tabs (to make them dark) in code the tab background is always white
Image

Also unless I render the tabs the selected tab is not highlighted.

I need tabs and the space behind the tabs to be dark, this is separate from the main area of the tab which I either want Blank or don't care about.

Steps to reproduce

Add TabControl to Form, add some TabPages and set

Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults
    e.ColorMode = SystemColorMode.Dark
End Sub

From Form1.Designer

' 
' TabControl1
' 
TabControl1.Controls.Add(TabPage1)
TabControl1.Controls.Add(TabPage2)
TabControl1.Dock = DockStyle.Fill
TabControl1.Location = New Point(0, 0)
TabControl1.Name = "TabControl1"
TabControl1.SelectedIndex = 0
TabControl1.Size = New Size(1388, 180)
TabControl1.TabIndex = 0
' 
' TabPage1
' 
TabPage1.Location = New Point(4, 24)
TabPage1.Name = "TabPage1"
TabPage1.Padding = New Padding(3)
TabPage1.Size = New Size(1380, 152)
TabPage1.TabIndex = 0
TabPage1.Text = "TabPage1"
' 
' TabPage2
' 
TabPage2.Location = New Point(4, 24)
TabPage2.Name = "TabPage2"
TabPage2.Padding = New Padding(3)
TabPage2.Size = New Size(1380, 152)
TabPage2.TabIndex = 1
TabPage2.Text = "TabPage2"
TabPage2.UseVisualStyleBackColor = True


Test with TabPage1.UseVisualStyleBackColor True and False on both .Net 9 and 10

Metadata

Metadata

Labels

area-DarkModeIssues relating to Dark Mode feature

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy