dotnet / dotnet/winforms

Designer's "undo" for resize does not work correctly when there is anchored control

Open
#9,218 3 comments 0 reactions 0 assignees View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

### Environment

Microsoft Visual Studio Professional 2022 (64-bit) - Version 17.6.2

### .NET version

.NET 7

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

I was using .NET framework and Visual Studio 2017. There was no such problem.

### Issue description

After clicking **undo** in designer for undoing a resize of a control, that "resize" is undone correctly. However, another anchored control is not undone correctly.
See the example below. Anchored textbox is not undone correctly.
![anchor_undo_issue](https://github.com/dotnet/winforms/assets/106665359/bcb6dece-2d66-43c1-bcb2-cb535ea2dea8)

### Steps to reproduce

Create a **Form**.
Create a **group-box**. Add a **textbox** inside the **groupbox**. Anchor the **textbox** to **groupbox**.
Anchor the **groupbox** to **form**.
Then resize the **form**. Then click "undo". Notice that, **textbox** is not undone correctly.

### Diagnostics

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.