Skip to main content
A newer version of this page is available. .

ScrollBarBase.ScrollBarAutoSize Property

Gets or sets a value specifying whether the scroll bar is automatically sized.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.Utils.v18.2.dll

Declaration

[DefaultValue(false)]
[DXCategory("Behavior")]
public bool ScrollBarAutoSize { get; set; }

Property Value

Type Default Description
Boolean **false**

true if the auto sizing feature is enabled; otherwise false.

Remarks

There are two types of scroll bars: vertical and horizontal - VScrollBar and HScrollBar. These classes inherit the ScrollBarAutoSize property from the ScrollBarBase class. There are two cases to be aware of:

  • Horizontal scroll bar

    When the ScrollBarAutoSize property is set to true, the scroll bar’s height is set to its default value (SystemInformation.HorizontalScrollBarHeight) and it can’t be changed either at design time or via code.

  • Vertical scroll bar

    When the ScrollBarAutoSize property is set to true, the scroll bar’s width is set to its default value (SystemInformation.VerticalScrollBarWidth) and it can’t be changed either at design time or via code.

Changing the ScrollBarAutoSize property value at runtime raises the ScrollBarBase.ScrollBarAutoSizeChanged event.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ScrollBarAutoSize property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also