Skip to content

Components within a panel are not positioned correctly at runtime if scrollbar is visible. #9849

@KieranDevvs

Description

@KieranDevvs

.NET version

7.0

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 response

Issue description

If components are anchored within a panel, and the scroll bar for the panel is NOT visible when loading the form, the components are positioned correctly.
If components are anchored within a panel, and the scroll bar for the panel IS visible when loading the form, the components are shifted to the left by the same number of pixels the scroll bar is wide.

Example of when the scrollbar is visible before loading the form:
image

Example of when the scroll bar is not visible before loading the form, but the form is resized to make the scroll bar visible after the fact:
image

Steps to reproduce

  1. Create a blank form
  2. Add a panel and dock it to the form.
  3. Add a component, resize it to the width of the panel and anchor it (Left, Top, Right).
  4. Set the panel to automatically show the scroll bar.
  5. Resize the form within the designer to make the scroll bar appear.
  6. Run the application and observe the difference between the designer and the running form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions