Skip to content

Fix issue 11914: In DarkMode: Add a default color to the ProcessBar.#14339

Open
SimonZhao888 wants to merge 2 commits intodotnet:mainfrom
SimonZhao888:fix_issue_11938
Open

Fix issue 11914: In DarkMode: Add a default color to the ProcessBar.#14339
SimonZhao888 wants to merge 2 commits intodotnet:mainfrom
SimonZhao888:fix_issue_11938

Conversation

@SimonZhao888
Copy link
Member

@SimonZhao888 SimonZhao888 commented Mar 2, 2026

Fixes #11914

Proposed changes

  • Add a default ForeColor, BackColor to the ProcessBar.

Customer Impact

  • The ProcessBar displays correctly in dark mode.

Regression?

  • Yes

Risk

  • Min

Screenshots

Before

image

After

image

Test methodology

  • Manually

Test environment(s)

  • 11.0.100-preview.1.26104.118
Microsoft Reviewers: Open in CodeFlow

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the WinForms ProgressBar dark mode initialization to apply specific colors when Application.IsDarkModeEnabled is true, to improve default appearance under dark mode.

Changes:

  • In ProgressBar.OnCreateControl, sets BackColor to SystemColors.ControlDarkDark and ForeColor to SystemColors.Highlight when dark mode is enabled.
  • Disables visual styles for the native ProgressBar via SetWindowTheme in dark mode.

@SimonZhao888 SimonZhao888 changed the title Fix issue 11938: In DarkMode: Add a default color to the ProcessBar. Fix issue 11914: In DarkMode: Add a default color to the ProcessBar. Mar 2, 2026
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.28515%. Comparing base (a4d6573) to head (2faadbb).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (a4d6573) and HEAD (2faadbb). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (a4d6573) HEAD (2faadbb)
Debug 6 2
production 4 2
unit 2 1
integration 2 1
test 2 0
Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #14339          +/-   ##
====================================================
- Coverage   77.24039%   52.28515%   -24.95525%     
====================================================
  Files           3280        2050        -1230     
  Lines         645112      287049      -358063     
  Branches       47731       42033        -5698     
====================================================
- Hits          498287      150084      -348203     
+ Misses        143133      134065        -9068     
+ Partials        3692        2900         -792     
Flag Coverage Δ
Debug 52.28515% <0.00000%> (-24.95525%) ⬇️
integration 19.12043% <0.00000%> (+0.02724%) ⬆️
production 52.28515% <0.00000%> (+0.10743%) ⬆️
test ?
unit 49.64518% <0.00000%> (+0.08503%) ⬆️

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.

@LeafShi1
Copy link
Member

LeafShi1 commented Mar 5, 2026

@SimonZhao888 The contrast between the progress bar's color and the background is insufficient, even in Classic mode; further modifications may be needed in both modes.

DarkMode:
image

Classic Mode:
image

CC: @KlausLoeffelmann

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] Improve visual contrast of the ProgressBar control in dark mode.

4 participants