Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContainerControl incorrectly scales multiple times when moving from one ControlCollection to another. #12851

Open
ChristopherDShea opened this issue Jan 28, 2025 · 1 comment
Labels
area-HDPI HDPI, not specific to Dpi mode of app
Milestone

Comments

@ChristopherDShea
Copy link

.NET version

.NET 8.0

Did it work in .NET Framework?

Yes

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

Sample project appears to work in .NET 6.

Issue description

Setup:
The parent form has AutoScaleMode set to DPI, and is being shown on a display with resolution that would cause the form to scale (i.e. not 100%).

Issue:
When a ContainerControl is removed from one Controls collection and added to another, the ContainerControl is scaled multiple times (based on the default and inherited fonts?), leading to the size of the control changing each time it is moved.

Notice in the animation below, the size of the TextBox remains static, while the red ContainerControl gets longer.
Image

Steps to reproduce

ContainerControlSample.zip

  1. Run the sample on a display set above 100%.
  2. Click button3 on the initial Form2 to pull up the Form4 with the issue.
  3. Repeatedly click button1 on Form4.

Results:
The red ContainerControl gets longer with each button1 click.

@ChristopherDShea ChristopherDShea added the untriaged The team needs to look at this issue in the next triage label Jan 28, 2025
@Tanya-Solyanik
Copy link
Member

Please find the commit that introduced this issue and see if this is controlled by any quirks.

@Tanya-Solyanik Tanya-Solyanik added area-HDPI HDPI, not specific to Dpi mode of app and removed untriaged The team needs to look at this issue in the next triage labels Jan 28, 2025
@merriemcgaw merriemcgaw modified the milestones: 10.0 Preview2, .NET 10.0 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-HDPI HDPI, not specific to Dpi mode of app
Projects
None yet
Development

No branches or pull requests

3 participants