Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.93 KB

winform's-DomainUpDownControl-button's-actions-in-sync.md

File metadata and controls

41 lines (29 loc) · 1.93 KB

WinForm's Domain upbutton and downbutton actions are in sync now

Scope

Edge

Version Introduced

4.7.2

Source Analyzer Status

Not planned

Change Description

In the .NET Framework 4.7.1 and previous versions the xref:System.Windows.Forms.DomainUpDown control's xref:System.Windows.Forms.DomainUpDown.UpButton?displayProperty=nameWithType action is ignored when control text is present, and the developer is required to use xref:System.Windows.Forms.DomainUpDown.DownButton?displayProperty=nameWithType action on the control before using xref:System.Windows.Forms.DomainUpDown.UpButton?displayProperty=nameWithType action. Starting with the .NET Framework 4.7.2 both the xref:System.Windows.Forms.DomainUpDown.UpButton?displayProperty=nameWithType and xref:System.Windows.Forms.DomainUpDown.DownButton?displayProperty=nameWithType actions work independently in this scenario and remain in sync.

  • Quirked
  • Build-time break

Recommended Action

In order for an application to benefit from these changes, it must run on the .NET Framework 4.7.2 or later. The application can benefit from these changes in either of the following ways:

  • It is recompiled to target the .NET Framework 4.7.2. This change is enabled by default on Windows Forms applications that target the .NET Framework 4.7.2 or later.
  • It opts out of the legacy scrolling behavior by adding the following AppContext Switch to the <runtime> section of the app config file and setting it to false, as the following example shows.
<runtime>
        <AppContextSwitchOverrides value="Switch.System.Windows.Forms.DomainUpDown.UseLegacyScrolling=false"/>
</runtime>

Affected APIs

M:System.Windows.Forms.DomainUpDown.UpButton M:System.Windows.Forms.DomainUpDown.DownButton

Category

Windows Forms