Understanding the Initial Location of C# Autoscroll

Asked 2 years ago, Updated 2 years ago, 43 views

I am currently using C# to create a Windows application, but if I set autoscroll=true on the form, it will appear scrolling down when I load the form.Is this behavior a specification?Also, I don't want you to scroll, so I would appreciate it if you could tell me the solution.

c#

2022-09-29 22:06

1 Answers

Scroll to display the element if the focus control is outside the display range when the form is displayed.Basically, this is a natural behavior and should not be changed.First, check if initial focus is appropriate.

If you really want to scroll, you can force a scroll position change by setting 0 to VerticalScroll.Value or HorizontalScroll.Value after Form.Load (for example, Form.Shown events).


2022-09-29 22:06

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.