dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.41k stars 982 forks source link

Derived form is write protected #8882

Open r-schaefer opened 1 year ago

r-schaefer commented 1 year ago

Environment

Visual Studio 2022 - Community Edition, Version 17.5.2

.NET version

.Net 7.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

Yes: With Visual Studio 2019 and .Net Framework 4.6.2

Issue description

A derived form cannot be edited with VS 2022:

See attached project:

This form seems to be write protected. You cannot insert any control.

Steps to reproduce

  1. Open the project, compile it
  2. Open the form BaseMDIERPDataChild.cs and try inserting a control

Diagnostics

No response

r-schaefer commented 1 year ago

DXApplication58.zip

merriemcgaw commented 1 year ago

@Olina-Zhang can your team please try to repro this?

Olina-Zhang commented 1 year ago

@Olina-Zhang can your team please try to repro this?

Yes, we can repro it, it was caused by Base Form's WindowsState with Maximized value set, repro with out of process designer in Visual Studio 16.11.25 to the latest, not in-process designer. Cannot drag and drop controls to form designer, and can copy&paste or double-click controls.

r-schaefer commented 1 year ago

Many thanks for your quick support. Resetting the WindowState to Normal fixed the issues:

elachlan commented 1 year ago

Is there a corresponding designer issue created?

Olina-Zhang commented 1 year ago

WindowsState with Maximized

It is the designer issue: https://github.com/microsoft/winforms-designer/issues/5057.