AutoScroll
Enables scrollbars on a container when the content overflows.
Last updated
Was this helpful?
Enables scrollbars on a container when the content overflows.
Last updated
Was this helpful?
All Wisej.NET containers can scroll their content when the AutoScroll property is set to true (default is false - the content is truncated). When AutoScroll is true, Wisej.NET automatically shows or hides the horizontal or vertical scroll bars, unless the property has a value different than Both.
Once AutoScroll is true, and the container is able to scroll its content, you can control which scrollbar is visible by setting the ScrollBars property:
Both (Default). Horizontal and Vertical Scrollbars are shown or hidden as needed.
None. Scrollbars are never displayed, it's similar to setting AutoScroll = false.
Horizontal. Only the horizontal scrollbar is shown if needed.
Vertical. Only the vertical scrollbar is shown if needed.
Hidden. The scrollbars are never shown but touch scrolling and wheel scrolling is supported. It's usually used for mobile apps when the scrollbars should not be visible.
Check whether the horizontal scrollbar using the HorizontalScroll.Visible property, and if the vertical scrollbar is visible using the VerticalScroll.Visible property.
Regardless of the AutoScroll and ScrollBars properties, Wisej.NET applications can read or set the scroll position (forcing a scroll) of the container using the VerticalScroll.Value and HorizontalScroll.Value properties.
The scrolling area is calculated to fit the content exactly. If you want to add some margin at the bottom or to the right of the content, use the
You can also set a minimum size for the viewport (the scrolling area) to make the container scroll the content regardless of the space occupied by the child controls.
In the event handler_,_ you can check both the e.OldValue and e.NewValue to determine if the scrollbar was moved up or down, or the e.ScrollOrientation to determine if the Scroll event was fired by the horizontal or vertical scrollbar.
You can also use the e.Type enumeration to determine if the scroll position changed because of a Decrement scroll, an Increment, or if the scroll position was dragged to the First (top or left) position or to the Last (bottom or right) position.
Wisej.NET fully supports touch scrolling and inertia scrolling. When the user swipes a touch device it will initiate the inertia scrolling which will keep scrolling and firing the Scroll event while it slows down.
The Scroll event is one of the (fired only if there is a handler attached). When you handle the event, Wisej.NET will fire it every time the scroll position of either scroll bars (even if set to Hidden) changes.
When RightToLeft is true, the vertical scrollbar and the corner grip are automatically moved to the left. This is separate from the mirroring feature, which "flips" the layout of the child controls. See support.