Skip to content

Commit 1a8e8b1

Browse files
committed
fix TextBoxBase related Controls backColor problems
1 parent 93a2ef9 commit 1a8e8b1

File tree

1 file changed

+2
-1
lines changed
  • src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox

1 file changed

+2
-1
lines changed

src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,8 @@ private void EnsureReadonlyBackgroundColor(bool value)
949949
{
950950
// If we have no specifically defined back color, we set the back color in case we're in dark mode.
951951
if (Application.IsDarkModeEnabled
952-
&& DarkModeRequestState is true)
952+
&& DarkModeRequestState is true
953+
&& !ShouldSerializeBackColor())
953954
{
954955
base.BackColor = value ? SystemColors.ControlLight : SystemColors.Window;
955956
Invalidate();

0 commit comments

Comments
 (0)