Skip to content

Conversation

@LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Dec 23, 2025

Fixes #14155

Proposed changes

  • Preserve the core logic that prevents background color changes on hover when UseVisualStyleBackColor is false or custom colors are set
  • Deleted IsHighContrastHighlighted() checks from both GetButtonTextColor and GetButtonBackColor methods, allowing the adapter to focus solely on Dark Mode rendering
  • Replace color comparisons with Control.ShouldSerializeBackColor() and Control.ShouldSerializeForeColor() to accurately detect when users have explicitly set color properties

Customer Impact

  • When UseVisualStyleBackColor is set to false, buttons now maintain a consistent background color and no longer change appearance on hover/press states.

Regression?

  • Yes

Risk

  • Minimal

Screenshots

Before

DarkModeResults.mp4

After

AfterChanges.mp4

Test methodology

  • Manually

Test environment(s)

  • .net 11.0.0-alpha.1.25617.103
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner December 23, 2025 07:12
@github-actions github-actions bot added the area-DarkMode Issues relating to Dark Mode feature label Dec 23, 2025
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.15415%. Comparing base (01eefd4) to head (a785abe).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14161         +/-   ##
===================================================
+ Coverage   77.15180%   77.15415%   +0.00235%     
===================================================
  Files           3279        3279                 
  Lines         645333      645325          -8     
  Branches       47720       47718          -2     
===================================================
+ Hits          497886      497895          +9     
+ Misses        143754      143735         -19     
- Partials        3693        3695          +2     
Flag Coverage Δ
Debug 77.15415% <0.00000%> (+0.00235%) ⬆️
integration 18.98825% <0.00000%> (+0.00818%) ⬆️
production 52.01864% <0.00000%> (+0.00457%) ⬆️
test 97.40559% <ø> (ø)
unit 49.46638% <0.00000%> (-0.00107%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dark Mode] The button background shouldn't have the status change when mouse over it after setting the UseVisualStyleBackColor as false

1 participant