Skip to content

Form.VisualStylesMode cannot be changed from Inherit to Classic in the VS properties window #15012

Description

@Olina-Zhang

.NET version

.NET 11 RC1 SDK build

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No, new APIs feature in .NET 11: #14809

Issue description

The Form.VisualStylesMode property cannot be changed from Inherit to Classic through the Visual Studio WinForms Designer Properties window.

When VisualStylesMode is changed from Inherit to Classic in the VS Properties window, the value immediately reverts to Inherit, and no serialization code is generated for VisualStylesMode = Classic.

Other values, including Disabled, Net11, and Latest, can be selected and serialized as expected.

VisualStylesMode_Classic.mp4

The runtime API itself works correctly when the property is set programmatically, or Runtime UI testing:

this.VisualStylesMode = VisualStylesMode.Classic;
MessageBox.Show(this.VisualStylesMode.ToString());

The message box correctly displays:

Classic

VisualStylesMode_Runtime.mp4

So the property correctly returns Classic, confirming that the runtime implementation behaves as expected. The issue appears to be limited to the Visual Studio Designer/Property Grid serialization.

Steps to reproduce

  1. Create a new WinForms project targeting .NET 11.
  2. Open the Form in the Visual Studio Designer.
  3. Select the Form.
  4. In the Properties window, locate the VisualStylesMode property.
  5. Change the value from Inherit to Classic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NewApi-Net11Tracks issues for public APIs targeted for .NET 11.priority-1Work that is critical for the release, but we could probably ship without

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions