Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabControl difficult to support Dark mode #5225

Open
docfresh opened this issue Jul 10, 2021 · 8 comments
Open

TabControl difficult to support Dark mode #5225

docfresh opened this issue Jul 10, 2021 · 8 comments
Assignees
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation area-Theming
Milestone

Comments

@docfresh
Copy link

It seems WinForms on .NET 5 has no built-in support for dark mode theming. I can implement a custom darkmode theme switcher that sets BackColor and ForeColor on most controls easily, but TabControl doesn't support it. There is no built in way to override the paint event without building a custom control that inherits TabControl and overrides OnPaint/Draw. TabControl also seems unresponsive to the Win32 API SetWindowsTheme(). It would be wonderful if some properties were exposed to set BackColor and ForeColor on TabControl, and maybe some ways to draw the border of a selected tab, especially when Appearance = FlatButtons, to make it easier to theme "darkly". Or if Metro style tabcontrols were available for Winforms.

SetWindowTheme(tabInfo.Handle, "DarkMode_Explorer", null); [uxtheme.dll]

@docfresh docfresh added the api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation label Jul 10, 2021
@davidbuckleyni
Copy link

Please search first this has been talked about already #5166

@docfresh
Copy link
Author

I searched but thanks for the link. Built-in support for darkmode API and ability to set ForeColor/BackColor seem like 2 different things. Most WinForms controls you can easily override display behavior with color; TabControl seems immune and especially difficult, even with custom paint events. I've tried multiple packages and code samples trying to get something to look legit. So this is not just a general request for WinForms dark mode, but concern that TabControl is specifically inflexible

@merriemcgaw merriemcgaw added this to the .NET 8.0 milestone Aug 11, 2022
@Tanya-Solyanik Tanya-Solyanik modified the milestones: .NET 8.0, .NET 9.0 Jul 31, 2023
@JDA88
Copy link

JDA88 commented Nov 27, 2023

I faced the same issue, our darkmode implementation is stuck because of "TabControl"

@DavidWiseman
Copy link

I was able to work around this for my use case, but I agree that it should be much simpler.

@JDA88
Copy link

JDA88 commented Nov 30, 2023

The list of things you have to fix to have a decent dark mode is very long and once you make a few progresses, you step on stuff that cannot be fixed natively (like TabControl, ToolStripSeparator, ScrollBars, etc.)

Thanks @DavidWiseman I'll take a look at your approach

@JeremyKuhne
Copy link
Member

@KlausLoeffelmann how does your dark mode work impact this issue?

@KlausLoeffelmann
Copy link
Member

Still one of the problematic issues.

@lonitra lonitra modified the milestones: 9.0 RC1, 9.0 RC2 Aug 14, 2024
@willibrandon
Copy link
Contributor

I am hoping to improve TabControl dark mode in #12471.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation area-Theming
Projects
None yet
Development

No branches or pull requests