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

[Dark Mode] Some rows/columns and ColumnHeader/RowHeader in the DataGridView control have incorrect colors #11893

Open
Philip-Wang01 opened this issue Aug 16, 2024 · 2 comments · May be fixed by #11985
Labels
area-DarkMode Issues relating to Dark Mode feature 🚧 work in progress Work that is current in progress untriaged The team needs to look at this issue in the next triage

Comments

@Philip-Wang01
Copy link
Contributor

Philip-Wang01 commented Aug 16, 2024

.NET version

.NET SDK 9.0.100-rc.1.24415.1 + build private dll form winforms repo release/9.0 branch

Did it work in .NET Framework?

No

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

This is a new feature Dark Mode: #11857

Issue description

Button and combobox types rows/columns and ColumnHeader/RowHeader in the DataGridView control have incorrect colors
image

Steps to reproduce

  1. Create a WinForms .NET Core application with DataGridView control.
  2. Enable DarkMode by Application.SetColorMode(SystemColorMode.Dark) in program.cs file.
  3. Add different types of columns to the DataGridView, such as button, checkbox and combobox.
  4. Run the application.
  5. Observe the result.
@Philip-Wang01 Philip-Wang01 added the untriaged The team needs to look at this issue in the next triage label Aug 16, 2024
@memoarfaa
Copy link

memoarfaa commented Aug 16, 2024

@Philip-Wang01
Temporary solution is set "FlatStyle" to "FlatStyle.Flat"

I notice that Any normal Button has property FlatStyle set to "FlatStyle.Standard" or has "UseVisualStyleBackColor" set to "true"
will use light Color Mode

So any drawing related to Visual style will be in Light Mode like (ButtonRenderer , VisualStyleRenderer, UseVisualStyleBackColor, FlatStyle.Standard)

The WinForms team has no intention of supporting Dark Mode Visual style in .NET SDK 9 according to @KlausLoeffelmann statements here he say it will be completed in .NET SDK 10.

#10985 (comment)

You can see the difference between Buttons in this images on use Light ButtonRenderer and another use Dark ButtonRenderer

Light Mode ButtonRenderer

2024-08-16_11-59-20

Dark Mode ButtonRenderer

2024-08-16_12-18-11

@KlausLoeffelmann
Copy link
Member

KlausLoeffelmann commented Aug 17, 2024

The WinForms team has no intention of supporting Dark Mode Visual style in .NET SDK 9 .

Well, to be fair, we had every intention possible. And we all know of course, that the VisualStylesMode features, although technically a separate feature, is very closely related to the dark mode in a lot of areas - this just being one of them. But at one point we/I also need to accept, that Visual Styles might have introduced incompatibilities, where we cannot with good conscience accept something that we passionately want to let jeopardize the stability of the system. We're not saying that that would have happened. But we were "just" not sufficiently sure. And even this being an Experimental feature doesn't mean, it does not need to meet a min bar for stability and safety AND we are sure about that it has all that. Did it have it? Yeah, very likely. Were we 100% sure? No. That's why it was the right decision to slip it into 10. And we always knew, with the existing workload, that this could happen, and we reserved the right to slip it even up to the very end: We aimed and work hard for making it happen as an Experimental feature with the primary goal to collect feedback - NOT to use it in production until the very last minute. We could have made that call in May and say, no, it's too close, other work items with higher priority just made it necessary to postpone. And we definitely WOULD have made that call earlier, had that feature not been conceptualized as an experimental feature to begin with.

So, Dark Mode made it, Visual Styles did not.

It was the right call. @JeremyKuhne, @merriemcgaw.

@lonitra lonitra added the area-DarkMode Issues relating to Dark Mode feature label Aug 20, 2024
@memoarfaa memoarfaa linked a pull request Aug 25, 2024 that will close this issue
@dotnet-policy-service dotnet-policy-service bot added the 🚧 work in progress Work that is current in progress label Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DarkMode Issues relating to Dark Mode feature 🚧 work in progress Work that is current in progress untriaged The team needs to look at this issue in the next triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants