Class ScrollBar
A ScrollBar is a control that represents a horizontal or vertical scrollbar.
[ControlCategory("Common")]
public class ScrollBar : Control, IBaseObjectWithId, IDisposableObject, IBaseObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
- Inheritance
-
ScrollBar
- Implements
- Derived
Remarks
A scrollbar has the following main attributes: range, thumb size, page size, and position. The range is the total number of units associated with the view represented by the scrollbar. For a table with 15 columns, the range would be 15. The thumb size is the number of units that are currently visible. For the table example, the window might be sized so that only 5 columns are currently visible, in which case the application would set the thumb size to 5. When the thumb size becomes the same as or greater than the range, the scrollbar will be automatically hidden on most platforms. The page size is the number of units that the scrollbar should scroll by, when 'paging' through the data. This value is normally the same as the thumb size length, because it is natural to assume that the visible window size defines a page. The scrollbar position is the current thumb position. Most applications will find it convenient to provide a function called AdjustScrollbars() which can be called initially, from an OnSize event handler, and whenever the application data changes in size. It will adjust the view, object and page size according to the size of the window and the size of the data.
Constructors
- ScrollBar()
Initializes a new instance of the ScrollBar class.
- ScrollBar(Control)
Initializes a new instance of the ScrollBar class.
Properties
- AltPosInfo
Gets scrollbar position as ScrollBar.AltPositionInfo.
- BackgroundColor
Gets or sets the background color for the control.
- Font
Gets or sets the font of the text displayed by the control.
- ForegroundColor
Gets or sets the foreground color for the control.
- IsBold
Gets or sets whether font style override is bold.
- IsVertical
Gets or sets whether ScrollBar is vertical.
- LargeChange
Gets or sets a value to be added to or subtracted from the Value property when the scroll box is moved a large distance.
- Maximum
Gets or sets the upper limit of values of the scrollable range.
- Metrics
Gets or sets metrics used to paint this scrollbar when its style is non-system.
- Minimum
Gets or sets the lower limit of values of the scrollable range.
- Padding
Gets or sets the padding inside a control.
- PosInfo
Gets scrollbar position as ScrollBarInfo.
- SmallChange
Gets or sets the value to be added to or subtracted from the Value property when the scroll thumb is moved a small distance.
- SystemTheme
Gets or sets which theme to use when System is used.
- Value
Gets or sets a numeric value that represents the current position of the scroll thumb on the scroll bar control.
Methods
- ArrowBitmapSizeFromMetrics()
Gets size of the arrow bitmap from the Metrics.
- CreateHandler()
Creates a handler for the control.
- DefaultMetrics(AbstractControl)
Gets or sets default metrics used to paint non-system scrollbars.
- GetCornerSize(AbstractControl)
Gets size of the scrollbar corner for the specified control.
- GetRealMetrics()
Gets real scroll bar metrics. If Metrics is not specified, returns DefaultMetrics(AbstractControl).
- GetScrollBarInfo(bool)
This method should not be used in the ScrollBar.
- LogInfo()
Logs scrollbar info.
- OnLocationChanged(EventArgs)
Called when the LocationChanged event is raised.
- OnSizeChanged(EventArgs)
Called when the SizeChanged event.
- OnValueChanged(EventArgs)
Called when ValueChanged event is raised.
- RaiseHandlerScroll(ScrollEventType, int)
Raises scroll event.
- RaiseValueChanged()
Raises the ValueChanged event and OnValueChanged(EventArgs) method.
- SetScrollBarInfo(bool, ScrollBarInfo)
This method should not be used in the ScrollBar.
- SetScrollbar(int?, int?, int?, bool)
Sets the native scrollbar properties.
- SizeFromMetrics()
Gets size of the scrollbar from the Metrics.
- ThumbSizeFromMetrics()
Gets size of the scroll thumb from the Metrics.
- ToString()
Returns a string that represents the ScrollBar control.
- UpdateScrollInfo()
Updates scroll info and calls SetScrollbar(int?, int?, int?, bool) to update native control.
Events
- IsVerticalChanged
Occurs when the IsVertical property is changed.
- ValueChanged
Occurs when the Value property is changed, either by a Scroll event or programmatically.