Selected TableLayoutSettings properties throw InvalidEnumArgumentException

Selected TableLayoutSettings properties now throw an InvalidEnumArgumentException if you attempt to assign an incorrect value.

Change description

In previous .NET versions, these properties throw an ArgumentOutOfRangeException if you attempt to assign an incorrect value. Starting in .NET 6, these properties throw an InvalidEnumArgumentException in such cases.

Change category

This change affects binary compatibility.

Reason for change

Throwing InvalidEnumArgumentException is in line with the existing Windows Forms API in similar situations. Throwing this exception also provides developers with a better debug experience.

Version introduced

.NET 6

Affected APIs