diff --git a/src/System.Windows.Forms/System/Windows/Forms/Form.cs b/src/System.Windows.Forms/System/Windows/Forms/Form.cs index 78d01467ad0..aa8ec0354a2 100644 --- a/src/System.Windows.Forms/System/Windows/Forms/Form.cs +++ b/src/System.Windows.Forms/System/Windows/Forms/Form.cs @@ -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() { @@ -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); }