Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ScrollBarBase.ScrollBarAutoSize Property

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

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

#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.

See Also