Skip to main content
Version: 4.1

ScrollableControlExtensions

Namespace: Wisej.Web.Markup

Assembly: Wisej.Framework (4.1.0.0)

Adds fluent markup extension methods to the ScrollableControl class.

public class ScrollableControlExtensions

Methods

Static member AutoScroll<TControl>(control, autoScroll)

Sets the AutoScroll property for the specified ScrollableControl, enabling or disabling automatic scrolling.

ParameterTypeDescription
TControlThe type of the control, which must inherit from ScrollableControl.
controlTControlThe scrollable control for which to set the AutoScroll property.
autoScrollBooleanA boolean value indicating whether to enable automatic scrolling. Default is false.

Returns: TControl. The scrollable control with the updated AutoScroll property.

This method allows you to control whether the control automatically displays scroll bars when its contents exceed its visible boundaries.


myScrollableControl.AutoScroll(true);

Static member AutoScrollMargin<TControl>(control, autoScrollMargin)

Sets the AutoScrollMargin property of the specified ScrollableControl.

ParameterTypeDescription
TControlThe type of the control, must inherit from ScrollableControl.
controlTControlThe control for which to set the AutoScrollMargin property.
autoScrollMarginSizeA Size representing the scroll margin.

Returns: TControl. The modified control with the updated AutoScrollMargin property.

This method allows you to specify the margin around the scrollable area of the control.


myScrollableControl.AutoScrollMargin(new Size(10, 10));

Static member AutoScrollMinSize<TControl>(control, autoScrollMinSize)

Sets the AutoScrollMinSize property of the specified ScrollableControl.

ParameterTypeDescription
TControlThe type of the control, must inherit from ScrollableControl.
controlTControlThe control for which to set the AutoScrollMinSize property.
autoScrollMinSizeSizeA Size representing the minimum scrollable size.

Returns: TControl. The modified control with the updated AutoScrollMinSize property.

This method allows you to specify the minimum size of the scrollable area of the control.


myScrollableControl.AutoScrollMinSize(new Size(100, 100));

Static member OnScroll<TControl>(control, action)

Attaches a scroll event handler to a ScrollableControl.

ParameterTypeDescription
TControlThe type of the scrollable control.
controlTControlThe control to which the scroll event handler is attached.
actionAction<TControl, ScrollEventArgs>The action to perform when the scroll event is triggered.

Returns: TControl. The control with the attached scroll event handler.

This method allows you to easily attach a scroll event handler to a scrollable control. The provided action is executed whenever the scroll event occurs.


var myScrollableControl = new MyScrollableControl();
myScrollableControl.OnScroll((control, args) =>
{
// Handle scroll event
});

Static member ScrollBars<TControl>(control, scrollBars)

Sets the ScrollBars property of the specified ScrollableControl.

ParameterTypeDescription
TControlThe type of the control, must inherit from ScrollableControl.
controlTControlThe control for which to set the ScrollBars property.
scrollBarsScrollBarsA ScrollBars value indicating which scroll bars to display.

Returns: TControl. The modified control with the updated ScrollBars property.

This method allows you to specify which scroll bars are displayed for the control. This is assumed to be part of a custom implementation.


myScrollableControl.ScrollBars(ScrollBars.Both);