Skip to content

Fix issue 14025: [DarkMode] the item lost dot line when using the mouse to expand the dropdown panel for SelectionPanelRadioButton#14710

Open
SimonZhao888 wants to merge 2 commits into
dotnet:mainfrom
SimonZhao888:Fix_Issue_14025
Open

Fix issue 14025: [DarkMode] the item lost dot line when using the mouse to expand the dropdown panel for SelectionPanelRadioButton#14710
SimonZhao888 wants to merge 2 commits into
dotnet:mainfrom
SimonZhao888:Fix_Issue_14025

Conversation

@SimonZhao888

@SimonZhao888 SimonZhao888 commented Jul 7, 2026

Copy link
Copy Markdown
Member

Fixes #14025

Root Cause

SelectionPanelRadioButton relies on native painting when used with Appearance.Button, if the focus rectangle is not drawn after native painting completes, it can be missing or inconsistent under certain themes/modes.

Proposed changes

  • Override WndProc in SelectionPanelRadioButton and handle WM_PAINT.
  • Call base.WndProc(ref m) first to preserve native button visuals.
  • Only when Focused && ShowFocusCues, overlay the focus cue by calling ControlPaint.DrawFocusRectangle(...) after WM_PAINT.
  • Keep a small inset and bounds validation for the focus rectangle to avoid invalid drawing.

Customer Impact

  • [Dark Mode] When using the mouse to expand the dropdown panel for the "Selection Panel" radio button, the dashed line displays correctly

Regression?

  • No

Risk

  • Mini

Screenshots

Before

image

After

Dark Mode

14025.mp4

Normal

14025-1.mp4

Test methodology

  • Manually

Test environment(s)

  • 11.0.0-preview.6.26317
Microsoft Reviewers: Open in CodeFlow

…se to expand the dropdown panel for SelectionPanelRadioButton
@SimonZhao888 SimonZhao888 requested a review from a team as a code owner July 7, 2026 06:06
@SimonZhao888 SimonZhao888 requested review from Copilot and removed request for a team July 7, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a dark-mode rendering regression in the WinForms designer “Selection Panel” radio-button UI by ensuring the focus cue (dotted rectangle) is drawn consistently after native painting.

Changes:

  • Overrides SelectionPanelRadioButton.WndProc to intercept WM_PAINT.
  • Calls base.WndProc(ref m) first to preserve native button rendering, then overlays a focus rectangle when Focused and focus cues are shown.
  • Adds basic bounds validation/inset to avoid invalid focus-rectangle drawing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

[DarkMode] the item lost dot line when using the mouse to expand the dropdown panel for the Dock/TextAlign/ImageAlign/CheckAlign properties

2 participants