Skip to content

DarkMode (c) Fix TitleBar issues #13468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: klaus/preview5/B
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/System.Windows.Forms/System/Windows/Forms/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3358,7 +3358,7 @@ protected override void CreateHandle()
}
}

// Deactivates active MDI child and temporarily marks it as unfocusable,
// Deactivates active MDI child and temporarily marks it as un-focusable,
// so that WM_SETFOCUS sent to MDIClient does not activate that child.
private void DeactivateMdiChild()
{
Expand Down Expand Up @@ -4897,6 +4897,23 @@ internal override unsafe void RecreateHandleCore()
Debug.Assert(result);
}

#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.
if (TopLevel && IsHandleCreated)
{
FormCornerPreference formCornerPreference = Properties.GetValueOrDefault(s_propFormCornerPreference, FormCornerPreference.Default);
SetFormCornerPreferenceInternal(formCornerPreference);

Color colorValue = Properties.GetValueOrDefault(s_propFormCaptionTextColor, Color.Empty);
SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_TEXT_COLOR, colorValue);

colorValue = Properties.GetValueOrDefault(s_propFormCaptionBackColor, Color.Empty);
SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_CAPTION_COLOR, colorValue);

colorValue = Properties.GetValueOrDefault(s_propFormBorderColor, Color.Empty);
SetFormAttributeColorInternal(DWMWINDOWATTRIBUTE.DWMWA_BORDER_COLOR, colorValue);
}
#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.

GC.KeepAlive(this);
}

Expand Down
Loading