Skip to content

Fix issue 14501: TabControl inside SplitContainer inside TabControl does not match dark mode - #14504

Merged
SimonZhao888 merged 3 commits into
dotnet:mainfrom
SimonZhao888:Fix_issue_14501
Jul 1, 2026
Merged

SimonZhao888 merged 3 commits into
dotnet:mainfrom
SimonZhao888:Fix_issue_14501

Conversation

@SimonZhao888

@SimonZhao888 SimonZhao888 commented Apr 29, 2026 •

Copy link
Copy Markdown
Member

Fixes #14501

Proposed changes

  • In TabControl dark-mode child theming (StyleChildren(HWND)), skip applying the generic DarkMode_Explorer theme to child windows that are themselves TabControl.
  • Keep existing dark-mode theming behavior for other child windows unchanged.
  • This prevents parent TabControl from overriding the nested TabControl-specific theme in hierarchies like:
    TabControl -> SplitContainer -> TabControl

Customer Impact

  • Nested TabControl now matches dark mode correctly when hosted inside a SplitContainer inside another TabControl.
  • Reduces visual inconsistency caused by theme override in nested container scenarios.

Regression?

  • No

Risk

  • Minimal.

Screenshots

Before

image

After

image

Test methodology

  • Manually

Test environment(s)

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

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 WinForms dark-mode theming for nested TabControl instances (e.g., TabControl -> SplitContainer -> TabControl) by preventing a parent TabControl from overriding the nested TabControl’s specialized theme during child-window styling.

Changes:

  • Updates TabControl dark-mode child theming (StyleChildren(HWND)) to skip applying the generic DarkMode_Explorer theme to descendant windows that are themselves TabControl instances.
  • Keeps existing theming behavior for all other descendant windows.

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

@SimonZhao888 SimonZhao888 added the waiting-review This item is waiting on review by one or more members of team label Apr 29, 2026

@LeafShi1 LeafShi1 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.

Thanks for the fix! I have a couple of observations/questions below.

@LeafShi1 LeafShi1 added this to the 11.0-preview7 milestone Jul 1, 2026
@SimonZhao888
SimonZhao888 merged commit dbbab5b into dotnet:main Jul 1, 2026
8 checks passed
@SimonZhao888
SimonZhao888 deleted the Fix_issue_14501 branch July 1, 2026 03:06
@dotnet-policy-service dotnet-policy-service Bot removed the waiting-review This item is waiting on review by one or more members of team label Jul 1, 2026
@LeafShi1 LeafShi1 added the releasenotes-candidate This issue is a candidate to be mentioned in the release notes, if the respective PR fixed it. label Jul 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-DarkMode Issues relating to Dark Mode feature releasenotes-candidate This issue is a candidate to be mentioned in the release notes, if the respective PR fixed it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[WinForms][DarkMode]TabControl inside SplitContainer inside TabControl does not match dark mode

5 participants