From c8f3f409b86a61524b1462020616cc02bd7aa321 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 31 Jan 2023 16:35:37 -0800 Subject: [PATCH 1/6] colordepth default change --- docs/core/compatibility/8.0.md | 1 + docs/core/compatibility/toc.yml | 4 +++ .../windows-forms/8.0/imagelist-colordepth.md | 36 +++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 docs/core/compatibility/windows-forms/8.0/imagelist-colordepth.md diff --git a/docs/core/compatibility/8.0.md b/docs/core/compatibility/8.0.md index 5e38059d4ae19..a4d44d35349e1 100644 --- a/docs/core/compatibility/8.0.md +++ b/docs/core/compatibility/8.0.md @@ -43,5 +43,6 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff | Title | Type of change | Introduced | | ----------------------------------------------------------------------------------------------------- | ------------------- | ---------- | | [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 | +| [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 | | [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 | | [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 | diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index b97b4e5fdc6ea..367c5f7c4af48 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -36,6 +36,8 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: ImageList.ColorDepth default is Depth32Bit + href: windows-forms/8.0/imagelist-colordepth.md - name: Top-level forms scale size to DPI href: windows-forms/8.0/forms-scale-size-to-dpi.md - name: WFDEV002 obsoletion is now an error @@ -1362,6 +1364,8 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: ImageList.ColorDepth default is Depth32Bit + href: windows-forms/8.0/imagelist-colordepth.md - name: Top-level forms scale size to DPI href: windows-forms/8.0/forms-scale-size-to-dpi.md - name: WFDEV002 obsoletion is now an error diff --git a/docs/core/compatibility/windows-forms/8.0/imagelist-colordepth.md b/docs/core/compatibility/windows-forms/8.0/imagelist-colordepth.md new file mode 100644 index 0000000000000..7f87ea77cf434 --- /dev/null +++ b/docs/core/compatibility/windows-forms/8.0/imagelist-colordepth.md @@ -0,0 +1,36 @@ +--- +title: "Breaking change: ImageList.ColorDepth default is Depth32Bit" +description: Learn about the breaking change in .NET 8 for Windows Forms where the default value of ImageList.ColorDepth has changed from Depth8Bit to Depth32Bit. +ms.date: 01/31/2023 +--- +# ImageList.ColorDepth default is Depth32Bit + +The default value for has changed over time. Starting in .NET 8, the default value has changed from to . This change affects both new and existing applications if they're upgraded to target .NET 8. + +## Version introduced + +.NET 8 Preview 1 + +## Previous behavior + +The default value for was . + +## New behavior + +If you haven't explicitly set for an image list, the color depth will automatically be reset to . This could increase your app's memory usage. + +## Change category + +This change is a [*behavioral change*](../../categories.md#behavioral-change). + +## Reason for change + +The default value was changed to improve image quality. + +## Recommended action + +If you want to continue using the previous color depth, explicitly set to . + +## Affected APIs + +- From f8a289ef468dd4851a8eb301af54ac4845e44abc Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 31 Jan 2023 17:03:40 -0800 Subject: [PATCH 2/6] autoscalemode breaking change --- docs/core/compatibility/8.0.md | 1 + docs/core/compatibility/toc.yml | 4 ++ .../8.0/top-level-window-scaling.md | 42 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md diff --git a/docs/core/compatibility/8.0.md b/docs/core/compatibility/8.0.md index a4d44d35349e1..904912a6da9ca 100644 --- a/docs/core/compatibility/8.0.md +++ b/docs/core/compatibility/8.0.md @@ -43,6 +43,7 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff | Title | Type of change | Introduced | | ----------------------------------------------------------------------------------------------------- | ------------------- | ---------- | | [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 | +| [Forms scale according to AutoScaleMode](windows-forms/8.0/top-level-window-scaling.md) | Behavioral change | Preview 1 | | [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 | | [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 | | [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 | diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 367c5f7c4af48..8e79099e3f841 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -36,6 +36,8 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: Forms scale according to AutoScaleMode + href: windows-forms/8.0/top-level-window-scaling.md - name: ImageList.ColorDepth default is Depth32Bit href: windows-forms/8.0/imagelist-colordepth.md - name: Top-level forms scale size to DPI @@ -1364,6 +1366,8 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: Forms scale according to AutoScaleMode + href: windows-forms/8.0/top-level-window-scaling.md - name: ImageList.ColorDepth default is Depth32Bit href: windows-forms/8.0/imagelist-colordepth.md - name: Top-level forms scale size to DPI diff --git a/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md new file mode 100644 index 0000000000000..61f2284766710 --- /dev/null +++ b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md @@ -0,0 +1,42 @@ +--- +title: "Breaking change: Forms scale according to AutoScaleMode" +description: Learn about the breaking change in .NET 8 for Windows Forms where top-level windows in PerMonitorV2-mode apps scale according to AutoScaleMode. +ms.date: 01/31/2023 +--- +# Forms scale according to AutoScaleMode + +In -mode apps, Windows Forms has been using linear sizes (also known as DPI-scaled sizes) provided by Windows for top-level windows, regardless of the . This implementation was problematic when using the scaling mode, as scaling should be non-linear in this case. The child controls are scaled non-linearly and depend on the font that was assigned to the or child controls. + +This change enables [WM_GETDPISCALEDSIZE message](/windows/win32/hidpi/wm-getdpiscaledsize) handling for top-level objects. It utilizes [WM_GETDPISCALEDSIZE](/windows/win32/hidpi/wm-getdpiscaledsize) to let Windows know that the may need non-linear sizes depending on . + +## Version introduced + +.NET 8 Preview 1 + +## Previous behavior + +Previously, in -mode apps, top-level windows were scaled by Windows and ignored . This implementation resulted in inconsistent scaling between objects and their child controls. + +## New behavior + +In -mode apps, top-level windows (such as [Forms](xref:System.Windows.Forms.Form)) are scaled according to . This implementation ensures that top-level windows scale consistently with their child controls. + +## Change category + +This change is a [*behavioral change*](../../categories.md#behavioral-change). + +## Reason for change + +This change was made to improve the high-DPI experience for Windows Forms apps in mode. + +## Recommended action + +No action is required. + +## Affected APIs + +N/A + +## See also + +- [Top-level forms scale minimum and maximum size to DPI](forms-scale-size-to-dpi.md) From c174bc452ca9df81680aa896d43cb1270e31747f Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 31 Jan 2023 20:19:28 -0800 Subject: [PATCH 3/6] tweaks --- .../windows-forms/8.0/forms-scale-size-to-dpi.md | 4 ++++ .../windows-forms/8.0/top-level-window-scaling.md | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/windows-forms/8.0/forms-scale-size-to-dpi.md b/docs/core/compatibility/windows-forms/8.0/forms-scale-size-to-dpi.md index 3bb4dedcc235c..22f03d592ad9c 100644 --- a/docs/core/compatibility/windows-forms/8.0/forms-scale-size-to-dpi.md +++ b/docs/core/compatibility/windows-forms/8.0/forms-scale-size-to-dpi.md @@ -62,3 +62,7 @@ If the new behavior is problematic for you, you can opt out by setting `System.W ## Affected APIs N/A + +## See also + +- [Forms scale according to AutoScaleMode](top-level-window-scaling.md) diff --git a/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md index 61f2284766710..f98a4efa568ee 100644 --- a/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md +++ b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md @@ -5,9 +5,9 @@ ms.date: 01/31/2023 --- # Forms scale according to AutoScaleMode -In -mode apps, Windows Forms has been using linear sizes (also known as DPI-scaled sizes) provided by Windows for top-level windows, regardless of the . This implementation was problematic when using the scaling mode, as scaling should be non-linear in this case. The child controls are scaled non-linearly and depend on the font that was assigned to the or child controls. +In -mode apps, Windows Forms has been using linear sizes (also known as DPI-scaled sizes) provided by Windows for top-level windows, regardless of the . This implementation was problematic when using the scaling mode, where scaling should be non-linear. The child controls are scaled non-linearly and depend on the font that was assigned to the or child controls. -This change enables [WM_GETDPISCALEDSIZE message](/windows/win32/hidpi/wm-getdpiscaledsize) handling for top-level objects. It utilizes [WM_GETDPISCALEDSIZE](/windows/win32/hidpi/wm-getdpiscaledsize) to let Windows know that the may need non-linear sizes depending on . +This change enables `WM.GETDPISCALEDSIZE` message handling for top-level objects. It utilizes [WM_GETDPISCALEDSIZE](/windows/win32/hidpi/wm-getdpiscaledsize) to let Windows know that the may need non-linear sizes depending on . ## Version introduced From 200e6489a6fedc3c3cd119f56b358465d00b74b2 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 6 Feb 2023 14:43:43 -0800 Subject: [PATCH 4/6] new argument exceptions --- docs/core/compatibility/8.0.md | 16 ++++---- docs/core/compatibility/toc.yml | 8 ++++ .../windows-forms/8.0/exceptioncollection.md | 36 ++++++++++++++++++ .../8.0/tablelayoutstylecollection.md | 38 +++++++++++++++++++ 4 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 docs/core/compatibility/windows-forms/8.0/exceptioncollection.md create mode 100644 docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md diff --git a/docs/core/compatibility/8.0.md b/docs/core/compatibility/8.0.md index d1ddc2eb8d04d..e7731cf6439a1 100644 --- a/docs/core/compatibility/8.0.md +++ b/docs/core/compatibility/8.0.md @@ -48,10 +48,12 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff ## Windows Forms -| Title | Type of change | Introduced | -| ----------------------------------------------------------------------------------------------------- | ------------------- | ---------- | -| [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 | -| [Forms scale according to AutoScaleMode](windows-forms/8.0/top-level-window-scaling.md) | Behavioral change | Preview 1 | -| [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 | -| [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 | -| [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 | +| Title | Type of change | Introduced | +| ------------------------------------------------------------------------------------------------------ | ------------------- | ---------- | +| [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 | +| [ExceptionCollection ctor throws ArgumentException](windows-forms/8.0/exceptioncollection.md) | Behavioral change | Preview 1 | +| [Forms scale according to AutoScaleMode](windows-forms/8.0/top-level-window-scaling.md) | Behavioral change | Preview 1 | +| [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 | +| [TableLayoutStyleCollection throws ArgumentException](windows-forms/8.0/tablelayoutstylecollection.md) | Behavioral change | Preview 1 | +| [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 | +| [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 | diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index d1320f7f761e7..5b618e26db027 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -42,10 +42,14 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: ExceptionCollection ctor throws ArgumentException + href: windows-forms/8.0/exceptioncollection.md - name: Forms scale according to AutoScaleMode href: windows-forms/8.0/top-level-window-scaling.md - name: ImageList.ColorDepth default is Depth32Bit href: windows-forms/8.0/imagelist-colordepth.md + - name: TableLayoutStyleCollection throws ArgumentException + href: windows-forms/8.0/tablelayoutstylecollection.md - name: Top-level forms scale size to DPI href: windows-forms/8.0/forms-scale-size-to-dpi.md - name: WFDEV002 obsoletion is now an error @@ -1382,10 +1386,14 @@ items: items: - name: Anchor layout changes href: windows-forms/8.0/anchor-layout.md + - name: ExceptionCollection ctor throws ArgumentException + href: windows-forms/8.0/exceptioncollection.md - name: Forms scale according to AutoScaleMode href: windows-forms/8.0/top-level-window-scaling.md - name: ImageList.ColorDepth default is Depth32Bit href: windows-forms/8.0/imagelist-colordepth.md + - name: TableLayoutStyleCollection throws ArgumentException + href: windows-forms/8.0/tablelayoutstylecollection.md - name: Top-level forms scale size to DPI href: windows-forms/8.0/forms-scale-size-to-dpi.md - name: WFDEV002 obsoletion is now an error diff --git a/docs/core/compatibility/windows-forms/8.0/exceptioncollection.md b/docs/core/compatibility/windows-forms/8.0/exceptioncollection.md new file mode 100644 index 0000000000000..428d22aeb7c82 --- /dev/null +++ b/docs/core/compatibility/windows-forms/8.0/exceptioncollection.md @@ -0,0 +1,36 @@ +--- +title: "Breaking change: ExceptionCollection constructor throws ArgumentException" +description: Learn about the breaking change in .NET 8 for Windows Forms where the ExceptionCollection constructor now throws an exception if the input is not of type Exception. +ms.date: 02/06/2023 +--- +# ExceptionCollection ctor throws ArgumentException + +The constructor now throws an if the elements in the input array are not of type . + +## Version introduced + +.NET 8 Preview 1 + +## Previous behavior + +Previously, the constructor did not check the type passed in, which could delay failure until later in the process. No exceptions were thrown during object creation. + +## New behavior + +Starting in .NET 8, if the elements in the input array are not of type , an is thrown. + +## Change category + +This change is a [*behavioral change*](../../categories.md#behavioral-change). + +## Reason for change + +This change helps to make exception types consistent across the code base. + +## Recommended action + +For most scenarios, this change should not have a significant impact. However, consider updating your code to handle at constructor call sites. + +## Affected APIs + +- constructor diff --git a/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md b/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md new file mode 100644 index 0000000000000..0fcba76136469 --- /dev/null +++ b/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md @@ -0,0 +1,38 @@ +--- +title: "Breaking change: TableLayoutStyleCollection throws ArgumentException" +description: Learn about the breaking change in .NET 8 for Windows Forms where inserting or removing an object that's not a TableLayoutStyle throws an exception. +ms.date: 02/06/2023 +--- +# TableLayoutStyleCollection throws ArgumentException + + enforces the type passed to its collection operations. The [affected APIs](#affected-apis) now throw an instead of an if the input is not of type . + +## Version introduced + +.NET 8 Preview 1 + +## Previous behavior + +Previously, if the input couldn't be converted to type , an was thrown. + +## New behavior + +Starting in .NET 8, if the input can't be converted to type , an is thrown. + +## Change category + +This change is a [*behavioral change*](../../categories.md#behavioral-change). + +## Reason for change + +This change helps to make exception types consistent across the code base. + +## Recommended action + +For most scenarios, this change should not have a significant impact. However, if you previously handled , update your code to handle instead. + +## Affected APIs + +- +- +- From 5195b8862365f3470b042e2c3205e555985f3d47 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 6 Feb 2023 14:47:33 -0800 Subject: [PATCH 5/6] fix affected insert method --- .../windows-forms/8.0/tablelayoutstylecollection.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md b/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md index 0fcba76136469..6525aeceff4fc 100644 --- a/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md +++ b/docs/core/compatibility/windows-forms/8.0/tablelayoutstylecollection.md @@ -33,6 +33,6 @@ For most scenarios, this change should not have a significant impact. However, i ## Affected APIs -- - +- - From 5d683ace6c53cc006059c0b3a70beaf279c7cdf7 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:37:21 -0800 Subject: [PATCH 6/6] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Klaus Löffelmann <9663150+KlausLoeffelmann@users.noreply.github.com> Co-authored-by: Devendar Reddy Adulla --- .../windows-forms/8.0/top-level-window-scaling.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md index f98a4efa568ee..0aa468730418b 100644 --- a/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md +++ b/docs/core/compatibility/windows-forms/8.0/top-level-window-scaling.md @@ -7,7 +7,7 @@ ms.date: 01/31/2023 In -mode apps, Windows Forms has been using linear sizes (also known as DPI-scaled sizes) provided by Windows for top-level windows, regardless of the . This implementation was problematic when using the scaling mode, where scaling should be non-linear. The child controls are scaled non-linearly and depend on the font that was assigned to the or child controls. -This change enables `WM.GETDPISCALEDSIZE` message handling for top-level objects. It utilizes [WM_GETDPISCALEDSIZE](/windows/win32/hidpi/wm-getdpiscaledsize) to let Windows know that the may need non-linear sizes depending on . +This change enables `WM_GETDPISCALEDSIZE` message handling for top-level objects. It utilizes [WM_GETDPISCALEDSIZE](/windows/win32/hidpi/wm-getdpiscaledsize) to let Windows know that the may need non-linear sizes depending on . ## Version introduced @@ -15,7 +15,7 @@ This change enables `WM.GETDPISCALEDSIZE` message handling for top-level -mode apps, top-level windows were scaled by Windows and ignored . This implementation resulted in inconsistent scaling between objects and their child controls. +Previously, in -mode apps, top-level windows were scaled by Windows and disregarded as specified in the WinForms application. This implementation led to inconsistent scaling between objects and their child controls. ## New behavior