diff --git a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb index 53b35b76c3e..987e3311a16 100644 --- a/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb +++ b/src/Microsoft.VisualBasic.Forms/src/Microsoft/VisualBasic/ApplicationServices/WindowsFormsApplicationBase.vb @@ -832,6 +832,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets or sets the VisualStylesMode for the Application. ''' + ''' + ''' The that the application is running in. + ''' Protected Property VisualStylesMode As VisualStylesMode @@ -846,6 +849,9 @@ Namespace Microsoft.VisualBasic.ApplicationServices ''' ''' Gets or sets the ColorMode for the Application. ''' + ''' + ''' The that the application is running in. + ''' Protected Property ColorMode As SystemColorMode diff --git a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx index cf5f0ae9db7..6c0e0125a53 100644 --- a/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx +++ b/src/System.Windows.Forms.Analyzers.CodeFixes.CSharp/Resources/SR.resx @@ -120,4 +120,4 @@ Add DesignerSerializationVisibilityAttribute to property - + \ No newline at end of file diff --git a/src/System.Windows.Forms/src/Resources/SR.resx b/src/System.Windows.Forms/src/Resources/SR.resx index 61f8d5d1615..857451fd45a 100644 --- a/src/System.Windows.Forms/src/Resources/SR.resx +++ b/src/System.Windows.Forms/src/Resources/SR.resx @@ -7015,4 +7015,7 @@ Stack trace where the illegal operation occurred was: The color of the Form's text caption (title bar text). + + Event raised whenever the VisualStylesMode property changes. + \ No newline at end of file diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf index 85d39173750..c7baddbced2 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.cs.xlf @@ -2137,6 +2137,11 @@ Určuje, zda je ovládací prvek viditelný nebo skrytý. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf index aca74e9a036..a96c34df998 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.de.xlf @@ -2137,6 +2137,11 @@ Bestimmt, ob das Steuerelement sichtbar oder ausgeblendet ist. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf index 4b77a5e4f86..c6ecee5fd46 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.es.xlf @@ -2137,6 +2137,11 @@ Determina si el control está visible u oculto. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf index ffc0386fec5..d94ae6c4d91 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.fr.xlf @@ -2137,6 +2137,11 @@ Détermine si le contrôle est visible ou masqué. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf index 60ca1eb0d06..fa8f27397d5 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.it.xlf @@ -2137,6 +2137,11 @@ Determina se il controllo è visibile o nascosto. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf index d81fd21e89e..aa422dec5ca 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ja.xlf @@ -2137,6 +2137,11 @@ コントロールの表示、非表示を示します。 + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf index a8efafe19fe..ede6d146742 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ko.xlf @@ -2137,6 +2137,11 @@ 컨트롤을 표시할지 여부를 결정합니다. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf index 4c6ba64bff6..56dfabaadc1 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pl.xlf @@ -2137,6 +2137,11 @@ Określa, czy formant jest widoczny, czy ukryty. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf index 4975886a3b6..84d503cefe5 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.pt-BR.xlf @@ -2137,6 +2137,11 @@ Determina se o controle está visível ou oculto. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf index 280ed75f48e..1d396f35931 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.ru.xlf @@ -2137,6 +2137,11 @@ Определяет, отображается или скрыт данный элемент управления. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf index 0309f6dcacd..431514ce273 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.tr.xlf @@ -2137,6 +2137,11 @@ Denetimin görünür mü yoksa gizli mi olduğunu belirler. + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf index 9d6159a5c96..385a9a0e652 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hans.xlf @@ -2137,6 +2137,11 @@ 确定该控件是可见的还是隐藏的。 + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf index 1ba2fff8ebc..7786c74bfa4 100644 --- a/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf +++ b/src/System.Windows.Forms/src/Resources/xlf/SR.zh-Hant.xlf @@ -2137,6 +2137,11 @@ 決定控制項是可見或隱藏。 + + Event raised whenever the VisualStylesMode property changes. + Event raised whenever the VisualStylesMode property changes. + + Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. Determines how the control renders itself with visual styles. This ambient property can inherit its value from its parent control or, if it is a top-level control, from the application's default setting. diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs index dd3cc15c4ec..7ebf5062ad7 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Application.cs @@ -50,6 +50,7 @@ public sealed partial class Application private const string DarkModeKeyPath = "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; private const string DarkModeKey = "AppsUseLightTheme"; + private const int DarkModeNotAvailable = -1; /// /// Events the user can hook into @@ -250,7 +251,7 @@ internal static bool CustomThreadExceptionHandlerAttached /// Gets the default dark mode for the application. This is the SystemColorMode which either has been set /// by or its default value . /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public static SystemColorMode ColorMode => !s_systemColorMode.HasValue ? SystemColorMode.Classic @@ -262,7 +263,7 @@ internal static bool CustomThreadExceptionHandlerAttached /// Sets the default dark mode for the application. /// /// The default dark mode to set. - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public static void SetColorMode(SystemColorMode systemColorMode) { try @@ -308,7 +309,7 @@ public static void SetColorMode(SystemColorMode systemColorMode) /// is essential. /// /// - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public static VisualStylesMode DefaultVisualStylesMode { get; private set; } /// @@ -318,7 +319,7 @@ public static void SetColorMode(SystemColorMode systemColorMode) /// as not setting using . /// /// The version of visual styles to set. - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public static void SetDefaultVisualStylesMode(VisualStylesMode styleSetting) { if (styleSetting != DefaultVisualStylesMode) @@ -363,10 +364,10 @@ private static int GetSystemColorModeInternal() { if (SystemInformation.HighContrast) { - return -1; + return DarkModeNotAvailable; } - int systemColorMode = -1; + int systemColorMode = DarkModeNotAvailable; // Dark mode is supported when we are >= W11/22000 // Technically, we could go earlier, but then the APIs we're using weren't officially public. @@ -377,7 +378,7 @@ private static int GetSystemColorModeInternal() systemColorMode = (Registry.GetValue( keyName: DarkModeKeyPath, valueName: DarkModeKey, - defaultValue: -1) as int?) ?? systemColorMode; + defaultValue: DarkModeNotAvailable) as int?) ?? systemColorMode; } catch (Exception ex) when (!ex.IsCriticalException()) { diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs index 5090a836604..c4bd7863a17 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Control.cs @@ -3642,9 +3642,8 @@ public event EventHandler? VisibleChanged [SRCategory(nameof(SR.CatAppearance))] [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Advanced)] - // [SRDescription(nameof(SR.ControlVisualStylesModeChangedDescr))] - [SRDescription("VisualStyleMode Description.")] - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [SRDescription(nameof(SR.ControlVisualStylesModeChangedDescr))] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public event EventHandler? VisualStylesModeChanged { add => Events.AddHandler(s_visualStylesModeChangedEvent, value); @@ -3680,7 +3679,7 @@ public event EventHandler? VisualStylesModeChanged [SRCategory(nameof(SR.CatAppearance))] [EditorBrowsable(EditorBrowsableState.Always)] [SRDescription(nameof(SR.ControlVisualStylesModeDescr))] - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public VisualStylesMode VisualStylesMode { get => Properties.TryGetObject(s_visualStylesModeProperty, out VisualStylesMode value) @@ -3757,7 +3756,7 @@ private void ResetVisualStylesMode() /// whose default is . /// /// The default visual styles mode for the control. - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] protected virtual VisualStylesMode DefaultVisualStylesMode => Application.DefaultVisualStylesMode; /// @@ -7411,22 +7410,19 @@ protected virtual void OnParentVisibleChanged(EventArgs e) /// Occurs when the property of the parent of this control changed. /// [EditorBrowsable(EditorBrowsableState.Advanced)] - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] protected virtual void OnParentVisualStylesModeChanged(EventArgs e) { - if (Properties.ContainsObject(s_visualStylesModeProperty)) + if (Properties.ContainsObject(s_visualStylesModeProperty) + && Equals(Properties.GetObject(s_visualStylesModeProperty), Parent?.VisualStylesMode)) { - // If this DataContext was the same as the Parent's just became, - if (Equals(Properties.GetObject(s_visualStylesModeProperty), Parent?.VisualStylesMode)) - { - // we need to make it ambient again by removing it. - Properties.RemoveObject(s_visualStylesModeProperty); + // we need to make it ambient again by removing it. + Properties.RemoveObject(s_visualStylesModeProperty); - // Even though internally we don't store it any longer, and the - // value we had stored therefore changed, technically the value - // remains the same, so we don't raise the DataContextChanged event. - return; - } + // Even though internally we don't store it any longer, and the + // value we had stored therefore changed, technically the value + // remains the same, so we don't raise the DataContextChanged event. + return; } // In every other case we're going to raise the event. @@ -7568,7 +7564,7 @@ protected virtual void OnVisibleChanged(EventArgs e) /// Inheriting classes should override this method to handle this event. /// Call base. to send this event to any registered event listeners. /// - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] [EditorBrowsable(EditorBrowsableState.Advanced)] protected virtual void OnVisualStylesModeChanged(EventArgs e) { @@ -10893,7 +10889,8 @@ static unsafe void PrepareDarkMode(HWND hwnd, bool darkModeEnabled) hwnd, DWMWINDOWATTRIBUTE.DWMWA_USE_IMMERSIVE_DARK_MODE, &value, - (uint)sizeof(BOOL)); + (uint)sizeof(BOOL)).AssertSuccess(); + ; } } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs index 471bce02498..ce01588740e 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/ControlStyles.cs @@ -143,6 +143,6 @@ public enum ControlStyles /// from this setting. Note that using this settings will cause some /// win32 control theming renderers to become inactive for a specific theme. /// - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] ApplyThemingImplicitly = 0b00001000_00000000_00000000, // 0x00080000 } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/Appearance.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/Appearance.cs index 5941c850e86..1585571fe69 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/Appearance.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/Appearance.cs @@ -25,6 +25,6 @@ public enum Appearance /// This setting is not taken into account, when is set /// to or . /// - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] ToggleSwitch = 2 } diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/CheckBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/CheckBox.cs index da749db97b7..39f1f89b09f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/CheckBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/Buttons/CheckBox.cs @@ -211,7 +211,7 @@ public CheckState CheckState bool checkedChanged = oldChecked != Checked; - // In here, we take care of both the event changed events for Checked... + // In here, we take care of both the changed events for Checked and CheckState. if (checkedChanged) { OnCheckedChanged(EventArgs.Empty); @@ -219,7 +219,6 @@ public CheckState CheckState _notifyAccessibilityStateChangedNeeded = !checkedChanged; - // ...and Check_State_. OnCheckStateChanged(EventArgs.Empty); _notifyAccessibilityStateChangedNeeded = false; diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/RichTextBox/RichTextBox.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/RichTextBox/RichTextBox.cs index 6bbe304279f..1768b304fc0 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/RichTextBox/RichTextBox.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/RichTextBox/RichTextBox.cs @@ -446,11 +446,6 @@ internal override Size GetPreferredSizeCore(Size proposedConstraints) return preferredSize + scrollBarPadding; } - private protected override void OnNcPaint(Graphics graphics) - { - base.OnNcPaint(graphics); - } - private bool InConstructor { get => _richTextBoxFlags[s_fInCtorSection] != 0; @@ -2517,22 +2512,6 @@ protected override void OnHandleCreated(EventArgs e) SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(UserPreferenceChangedHandler); } - private void DefineClientRectangle() - { - RECT clientSize = default; - - // Define the client area of the RichText. - PInvoke.SendMessage(this, PInvoke.EM_GETRECT, (WPARAM)0, ref clientSize); - var padding = GetVisualStylesPadding(true); - - clientSize.right -= padding.Horizontal; - clientSize.bottom -= padding.Vertical; - clientSize.left += padding.Left; - clientSize.top += padding.Top; - - PInvoke.SendMessage(this, PInvoke.EM_SETRECT, (WPARAM)0, ref clientSize); - } - protected override void OnHandleDestroyed(EventArgs e) { base.OnHandleDestroyed(e); diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs index d42b833be76..d020bd84f69 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs @@ -823,7 +823,7 @@ public event EventHandler? MultilineChanged enumClass: typeof(VisualStylesMode)) }; - [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] protected virtual int PreferredHeightCore { get diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs index 533dceecbd5..735d8ced81f 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/SystemColorMode.cs @@ -5,7 +5,7 @@ namespace System.Windows.Forms { - [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] + [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public enum SystemColorMode { /// diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/VisualStylesMode.cs b/src/System.Windows.Forms/src/System/Windows/Forms/VisualStylesMode.cs index d3b86bf9c62..8a07a9f0ba9 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/VisualStylesMode.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/VisualStylesMode.cs @@ -8,7 +8,7 @@ namespace System.Windows.Forms; /// /// Represents the version of the visual renderer. /// -[Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/WfoExperimental/{0}")] +[Experimental(DiagnosticIDs.ExperimentalVisualStyles, UrlFormat = "https://aka.ms/winforms-experimental/{0}")] public enum VisualStylesMode { ///