Skip to content

Commit 2faadbb

Browse files
author
Simon Zhao (BEYONDSOFT CONSULTING INC)
committed
fix codes by suggestion
1 parent 2217665 commit 2faadbb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • src/System.Windows.Forms/System/Windows/Forms/Controls/ProgressBar

src/System.Windows.Forms/System/Windows/Forms/Controls/ProgressBar/ProgressBar.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ protected override void OnCreateControl()
8181

8282
if (Application.IsDarkModeEnabled)
8383
{
84-
BackColor = SystemColors.ControlDarkDark;
85-
ForeColor = SystemColors.Highlight;
84+
if (!ShouldSerializeBackColor())
85+
{
86+
BackColor = SystemColors.ControlDarkDark;
87+
ForeColor = SystemColors.Highlight;
88+
}
89+
8690
// Disables Visual Styles for the ProgressBar.
8791
PInvoke.SetWindowTheme(HWND, " ", " ");
8892
}

0 commit comments

Comments
 (0)