You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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)
#pragma warning restore WFO5001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Copy file name to clipboardExpand all lines: src/System.Windows.Forms/System/Windows/Forms/Controls/ComboBox/ComboBox.cs
+94-26Lines changed: 94 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -249,15 +249,31 @@ public AutoCompleteStringCollection AutoCompleteCustomSource
249
249
}
250
250
}
251
251
252
+
#pragma warning disable WFO5001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
252
253
/// <summary>
253
254
/// The background color of this control. This is an ambient property and
#pragma warning restore WFO5001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
0 commit comments