Skip to content

Fix disabled ComboBox rendering to use system disabled palette in modern visual styles - #14843

Merged
LeafShi1 merged 1 commit into
dotnet:mainfrom
LeafShi1:Fix_14797_disabled_ComboBox_render_issue
Aug 6, 2026
Merged

Fix disabled ComboBox rendering to use system disabled palette in modern visual styles#14843
LeafShi1 merged 1 commit into
dotnet:mainfrom
LeafShi1:Fix_14797_disabled_ComboBox_render_issue

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes #14797

Root cause

ComboBox.ModernComboAdapter computed its disabled appearance by muting the control's own BackColor/ForeColor ``(Mute(BackColor, 0.55f)) rather than using a fixed system disabled palette. Because the muted result is derived from user colors, a ComboBox with a custom BackColor still looked "colored" when disabled

Separately, ComboBox did not handle WM_CTLCOLORSTATIC for the native edit child. When disabled, Windows fell back to its default white background, which did not match the disabled surface the adapter painted for the rest of the field.

Proposed changes

  • Adds a shared disabled color palette to ModernControlColorMath (dark-mode and high-contrast aware) and makes the modern ComboBox adapter, the ComboBox WM_CTLCOLORSTATIC handler, and the modern Button renderers all read from it, so disabled controls stay visually consistent.

Customer Impact

  • A disabled ComboBox in modern visual styles now looks disabled: it uses the system disabled surface, border, and text colors instead of a washed-out version of the developer's custom colors. This makes the disabled state immediately recognizable and consistent with disabled Button and other modern controls, in both light and dark mode, and it resolves the white edit-field box previously visible in DropDown style.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

Light mode:
image

Dark mode:
image

After

Light mode:
image

Dark mode:
image

Test methodology

  • Unit test and manual tests

Test environment(s)

  • .net11.0.0-preview.7.26365.101
Microsoft Reviewers: Open in CodeFlow

@LeafShi1
LeafShi1 requested a review from a team as a code owner August 4, 2026 08:52
@LeafShi1
LeafShi1 force-pushed the Fix_14797_disabled_ComboBox_render_issue branch from 2ee1974 to 300b4c1 Compare August 5, 2026 09:02
@LeafShi1
LeafShi1 force-pushed the Fix_14797_disabled_ComboBox_render_issue branch from 300b4c1 to 3688fd6 Compare August 5, 2026 09:43

@KlausLoeffelmann KlausLoeffelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's just the one missing line - and I do not want to block this over that line, so, let's take this without addressing this. (The world will go on...)

But - let's make sure, we have a process, where we maintain both skills for code generation and code reviewing, so that those kinds of edits will be a thing of the past in a few months. 😸

@LeafShi1
LeafShi1 merged commit faf0029 into dotnet:main Aug 6, 2026
8 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combobox controls still render in BackColor/ForeColor after setting Enabled to False in NET11 VisualStylesMode

2 participants