Skip to content

Fix ProgressBar dark mode rendering inconsistency across style variants#14551

Open
LeafShi1 wants to merge 1 commit into
dotnet:mainfrom
LeafShi1:Fix_14546_ProgressBar_broken_appearance_in_DarkMode
Open

Fix ProgressBar dark mode rendering inconsistency across style variants#14551
LeafShi1 wants to merge 1 commit into
dotnet:mainfrom
LeafShi1:Fix_14546_ProgressBar_broken_appearance_in_DarkMode

Conversation

@LeafShi1
Copy link
Copy Markdown
Member

@LeafShi1 LeafShi1 commented May 21, 2026

Fixes #14546

Root Cause

The native themed ProgressBar rendering on newer Windows builds applies style-dependent visual effects in dark mode. As a result, Blocks, Continuous, and Marquee do not share a single consistent rendering path. When the control depends on native theming, the background and foreground colors can diverge across styles.

Proposed changes

  • Disable native ProgressBar theming in dark mode and drive ProgressBar colors through explicit color messages.
  • Reapply theming and colors after handle recreation, style changes, color changes, and user-preference updates.
  • Use SystemColors.ControlText as the dark-mode background color to satisfy contrast requirements.
  • Preserve system-controlled ProgressBar colors in the classic/native rendering path.
  • Apply explicit ProgressBar colors only in the dark-mode workaround path used to ensure consistent rendering across style variants.

Customer Impact

  • Fixes inconsistent ProgressBar appearance in dark mode and improves readability and contrast between the progress fill and background.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

Blocks, Continuous, and Marquee render with different visual results.

Recording.2026-05-20.095837.mp4

After

Three ProgressBar styles (Blocks, Continuous, Marquee) render with consistent colors in dark mode and color changes and style switching work correctly

AfterChanges.mp4

Test methodology

  • Manually

Test environment(s)

  • .net 11.0.0-preview.5.26268.112
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner May 21, 2026 06:15
@github-actions github-actions Bot added the area-DarkMode Issues relating to Dark Mode feature label May 21, 2026
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] ProgressBar broken appearance when changing ProgressBarStyle at runtime on Windows 11 25H2

1 participant