-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix nested container controls scaling that have AutoscaleMode as Inherit #6130
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
Conversation
| // Traverse thorugh parent hierarchy untill we get a ContainerControl whose AutoScaleMode is not Inherit. | ||
| // AutoscaleFactor from this parent is used to scale the child controls within its hierarchy. | ||
| while (parentControl is not null | ||
| && (parentControl is not ContainerControl containerControl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have other places with similar code walking the parent chain, don't we? Do we always skip non-container controls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AutoscaleFactor is property on ContainerControl . So, we have to traverse parent chain until we get the right scale factor for its children. Also, ContainerControl gets OnFonChanged events to scale the children. Non-Container controls that receive OnFontChanged does not scale control but just set the Font.
src/System.Windows.Forms/src/System/Windows/Forms/ContainerControl.cs
Outdated
Show resolved
Hide resolved
|
CTI cleared testing. |
…rit (dotnet#6130) * Fix nested container controls scaling that have AutoscaleMode as Inherit. Fixes dotnet#5957 and dotnet#6152.
Fix nested
Container Controlsscaling that haveAutoscaleModeasInherit. In this change we are making sure to traverse hierarchy all the way up until we get a container parent whoseAutoScaleModeis not Inherit and use it sAutoScaleFactorto scale children.Fixes #5957.
fixes #6152
Microsoft Reviewers: Open in CodeFlow