Skip to content

Conversation

@LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Dec 23, 2025

Fixes #14159

Root Cause:

  • The TabControl's spinner button is created on-demand by Windows when TabPages exceed available display space and Multiline = false
  • ApplyDarkModeOnDemand() only executes during handle creation (OnHandleCreated) or recreation (RecreateHandleCore)
  • When TabPages are added dynamically (e.g., through PropertyGrid), the spinner button child window is created without Dark Mode theme applied

Proposed changes

  • Added WM_PARENTNOTIFY message handling in TabControl's WndProc method to apply Dark Mode theme to dynamically created child windows (specifically the spinner button).

Customer Impact

  • Spinner buttons now correctly render in Dark Mode when TabPages are added dynamically through PropertyGrid

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

The Spinner button of Tabcontrol not in DarkMode when adding the TabPage items by using TabPages property in the PropretyGrid control

TabControlIssue.mp4

After

Dynamically created TabControl child windows (spinner buttons) now automatically receive Dark Mode theme when created

AfterChange.mp4

Test methodology

  • Manually

Test environment(s)

  • .net 11.0.0-alpha.1.25617.103
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner December 23, 2025 08:23
@github-actions github-actions bot added the area-DarkMode Issues relating to Dark Mode feature label Dec 23, 2025
@codecov
Copy link

codecov bot commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.15607%. Comparing base (01eefd4) to head (4abb279).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #14162         +/-   ##
===================================================
+ Coverage   77.15180%   77.15607%   +0.00427%     
===================================================
  Files           3279        3279                 
  Lines         645333      645340          +7     
  Branches       47720       47721          +1     
===================================================
+ Hits          497886      497919         +33     
+ Misses        143754      143731         -23     
+ Partials        3693        3690          -3     
Flag Coverage Δ
Debug 77.15607% <28.57143%> (+0.00427%) ⬆️
integration 18.99353% <28.57143%> (+0.01346%) ⬆️
production 52.02427% <28.57143%> (+0.01020%) ⬆️
test 97.40559% <ø> (ø)
unit 49.46797% <28.57143%> (+0.00052%) ⬆️

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.

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] The Spinner button of Tabcontrol not in DarkMode when adding the TabPage items by using TabPages property in the PropetyGrid control

1 participant