Commit ec3aa9a
authored
[Preview7/Release] Backport 13721 DarkMode: White background in disabled TextBox-composite controls (#13749)
Fixes the `ComboBox` and `RichTextBox` BackColor issue in dark mode,
where the background color was the same as in Classic mode (LightMode).
Both controls either use `TextBox(Base)` as/in a constituent control
approach or inherit from `TextBoxBase` (true for the `RichTextBox`).
While `ReadOnly` and normal edit mode work fine for both with regards to
correct coloring in dark mode, if they are disabled, they used the wrong
colors for the background.
This was pointed out by customers, and is a particular blocker for
GitHub Extensions, which discussed this effect here:
https://github.com/gitextensions/gitextensions/wiki/Dark-Mode#bright-disabled-textboxes
(Note that other issues which they pointed out we already addressed in
earlier .NET Preview versions, as soon as then priorities and
circumstances allowed us.)
We want to accommodate them and other customers who had similar issues
in this area as fast as possible to unblock them, so GitExtensions in
particular can provide their aspired .NET 10 based DarkMode-enabled
GitExtensions version as soon as .NET 10 becomes available.
Note, that `ComboBox` internally uses depending on the `ComboBox`
control's `DropDownStyle` different nested control types for different
modes. So, practically there are inner `ListBox` and `TextBox` controls
which had to be addressed:
<img width="553" height="456" alt="image"
src="https://github.com/user-attachments/assets/61821717-b509-4ecf-b703-89f7a0970c60"
/>
The fixed version has been tested by CTI and they also reassured that
the Classic mode code paths (LightMode rendering) remain unchanged to
further minimize any risks.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13749)File tree
6 files changed
+181
-74
lines changed- src/System.Windows.Forms/System/Windows/Forms
- Controls
- Buttons
- ComboBox
- ListView
- RichTextBox
- TextBox
6 files changed
+181
-74
lines changedLines changed: 31 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | 301 | | |
307 | 302 | | |
308 | 303 | | |
| |||
491 | 486 | | |
492 | 487 | | |
493 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
494 | 515 | | |
495 | 516 | | |
496 | 517 | | |
| |||
7384 | 7405 | | |
7385 | 7406 | | |
7386 | 7407 | | |
7387 | | - | |
| 7408 | + | |
7388 | 7409 | | |
7389 | 7410 | | |
7390 | 7411 | | |
| |||
9349 | 9370 | | |
9350 | 9371 | | |
9351 | 9372 | | |
9352 | | - | |
| 9373 | + | |
9353 | 9374 | | |
9354 | 9375 | | |
9355 | 9376 | | |
| |||
10345 | 10366 | | |
10346 | 10367 | | |
10347 | 10368 | | |
10348 | | - | |
| 10369 | + | |
10349 | 10370 | | |
10350 | | - | |
| 10371 | + | |
10351 | 10372 | | |
10352 | 10373 | | |
10353 | 10374 | | |
| |||
10412 | 10433 | | |
10413 | 10434 | | |
10414 | 10435 | | |
10415 | | - | |
| 10436 | + | |
10416 | 10437 | | |
10417 | 10438 | | |
10418 | 10439 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
Lines changed: 94 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
259 | 274 | | |
260 | 275 | | |
| 276 | + | |
261 | 277 | | |
262 | 278 | | |
263 | 279 | | |
| |||
1841 | 1857 | | |
1842 | 1858 | | |
1843 | 1859 | | |
1844 | | - | |
1845 | | - | |
1846 | | - | |
1847 | | - | |
1848 | | - | |
| 1860 | + | |
| 1861 | + | |
1849 | 1862 | | |
1850 | 1863 | | |
1851 | 1864 | | |
| |||
2384 | 2397 | | |
2385 | 2398 | | |
2386 | 2399 | | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
| 2400 | + | |
| 2401 | + | |
2392 | 2402 | | |
2393 | 2403 | | |
2394 | 2404 | | |
| |||
3042 | 3052 | | |
3043 | 3053 | | |
3044 | 3054 | | |
3045 | | - | |
3046 | | - | |
3047 | | - | |
3048 | | - | |
3049 | | - | |
| 3055 | + | |
| 3056 | + | |
3050 | 3057 | | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
| 3058 | + | |
| 3059 | + | |
3056 | 3060 | | |
3057 | | - | |
3058 | | - | |
3059 | | - | |
3060 | | - | |
3061 | | - | |
| 3061 | + | |
| 3062 | + | |
3062 | 3063 | | |
3063 | 3064 | | |
3064 | 3065 | | |
| |||
3620 | 3621 | | |
3621 | 3622 | | |
3622 | 3623 | | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
3623 | 3627 | | |
3624 | 3628 | | |
3625 | 3629 | | |
| |||
3672 | 3676 | | |
3673 | 3677 | | |
3674 | 3678 | | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
| 3687 | + | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
| 3696 | + | |
| 3697 | + | |
| 3698 | + | |
| 3699 | + | |
| 3700 | + | |
| 3701 | + | |
| 3702 | + | |
| 3703 | + | |
| 3704 | + | |
| 3705 | + | |
| 3706 | + | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
3675 | 3720 | | |
3676 | 3721 | | |
3677 | 3722 | | |
| |||
3767 | 3812 | | |
3768 | 3813 | | |
3769 | 3814 | | |
| 3815 | + | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
3770 | 3838 | | |
3771 | 3839 | | |
3772 | 3840 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4673 | 4673 | | |
4674 | 4674 | | |
4675 | 4675 | | |
4676 | | - | |
| 4676 | + | |
4677 | 4677 | | |
4678 | 4678 | | |
4679 | 4679 | | |
| |||
0 commit comments