Class RadScrollBarElement
Implements the basic functionality for scrolling.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[ComVisible(false)]
public class RadScrollBarElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Remarks
This class can be used both for horizontal and for vertical scrolling via its property ScrollType. In the Toolbox only the specialized children are put: RadHScrollBar and RadVScrollBar.
To adjust the value range of the scroll bar control, set the Minimum and Maximum properties. To adjust the distance the scroll thumb moves, set the SmallChange and LargeChange properties. To adjust the starting point of the scroll thumb, set the Value property when the control is initially displayed.
Constructors
RadScrollBarElement()
Declaration
public RadScrollBarElement()
Fields
DefaultScrollType
Declaration
public const ScrollType DefaultScrollType = ScrollType.Horizontal
Field Value
ScrollType
|
GradientAngleCorrectionProperty
Declaration
public static readonly RadProperty GradientAngleCorrectionProperty
Field Value
RadProperty
|
HorizontalScrollBarHeight
Declaration
public static int HorizontalScrollBarHeight
Field Value
System.Int32
|
IsMouseOverScrollBarProperty
MinThumbLengthProperty
PressedProperty
ScrollTypeProperty
ThumbLengthProportionProperty
Declaration
public static readonly RadProperty ThumbLengthProportionProperty
Field Value
RadProperty
|
VerticalScrollBarWidth
Declaration
public static int VerticalScrollBarWidth
Field Value
System.Int32
|
Properties
BorderElement
ClampValue
Indicates whether invalid values should be clamped or an exception should be thrown
Declaration
public bool ClampValue { get; set; }
Property Value
System.Boolean
|
FillElement
FirstButton
Gets the first button element of this scrollbar
Declaration
public ScrollBarButton FirstButton { get; }
Property Value
ScrollBarButton
|
GradientAngleCorrection
Controls the angle that the fill primitive will be rotated when switching from horizontal to vertical orientation
Declaration
[RadPropertyDefaultValue("GradientAngleCorrection", typeof(RadScrollBarElement))]
public float GradientAngleCorrection { get; set; }
Property Value
System.Single
|
LargeChange
Gets or sets a value to be added to or subtracted from the Value property when the scroll thumb is moved a large distance.
Declaration
public int LargeChange { get; set; }
Property Value
System.Int32
A numeric value. The default value is 10. |
Remarks
When the user presses the PAGE UP or PAGE DOWN key, clicks in the scroll bar track on either side of the scroll thumb, or calls one of the PageXXX() functions, the Value property changes according to the value set in the LargeChange property.
Maximum
Gets or sets the upper limit of the scrollable range.
Declaration
public int Maximum { get; set; }
Property Value
System.Int32
A numeric value. The default value is 100. |
Remarks
NOTE: The value of a scroll bar cannot reach its maximum value through user interaction at run time. The maximum value that can be reached is equal to the Maximum property value minus the LargeChange property value plus 1. The maximum value can only be reached programmatically.
Minimum
Gets or sets the lower limit for the values of the scrollable range.
Declaration
public int Minimum { get; set; }
Property Value
System.Int32
A numeric value. The default value is 0. |
MinThumbLength
Gets or sets the minimum length of the scrolling thumb. See ThumbLength for more information about thumb length.
Declaration
[RadPropertyDefaultValue("MinThumbLength", typeof(RadScrollBarElement))]
public int MinThumbLength { get; set; }
Property Value
System.Int32
An integer value that gives the minimum thumb length. It is taken into account no matter if the thumb length is calculated automatically or the thumb length is set explicitly. The thumb length could be smaller than MinThumbLength if there is no space in the scroll bar. |
ScrollTimerDelay
Gets or sets the scroll timer delay
Declaration
public int ScrollTimerDelay { get; set; }
Property Value
System.Int32
|
ScrollType
Gets or sets the ScrollType - it could be horizontal or vertical.
Declaration
[RadPropertyDefaultValue("ScrollType", typeof(RadScrollBarElement))]
public ScrollType ScrollType { get; set; }
Property Value
ScrollType
|
SecondButton
Gets the second button element of this scrollbar
Declaration
public ScrollBarButton SecondButton { get; }
Property Value
ScrollBarButton
|
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.
Declaration
public int SmallChange { get; set; }
Property Value
System.Int32
A numeric value. The default value is 1. |
Remarks
When the user presses one of the arrow keys, clicks one of the scroll bar buttons or calls one of the LineXXX() functions, the Value property changes according to the value set in the SmallChange property.
ThumbElement
Gets the thumb element of this scrollbar
Declaration
public ScrollBarThumb ThumbElement { get; }
Property Value
ScrollBarThumb
|
ThumbLength
Gets the length of the scrolling thumb. Thumb length is the thumb's height for vertical scroll bar and the thumb's width for horizontal scroll bar.
Declaration
public int ThumbLength { get; }
Property Value
System.Int32
|
ThumbLengthProportion
Gets or sets a value between 0.0 and 1.0 that indicates what part of the scrollable area can be occupied by the thumb. If the value is 0.0 then the thumb should be with length 0 but the property MinThumbLength will cause the thumb to be larger. If the value is 1.0 the thumb takes the whole area between the two scrolling buttons. Negative value means that the thumb length should be calculated automatically based on Minimum, Maximum and LargeChange values.
Declaration
[RadPropertyDefaultValue("ThumbLengthProportion", typeof(RadScrollBarElement))]
public double ThumbLengthProportion { get; set; }
Property Value
System.Double
|
Value
Gets or sets a numeric value that represents the current position of the scroll thumb on the scroll bar.
Declaration
public int Value { get; set; }
Property Value
System.Int32
A numeric value that is within the Minimum and Maximum range. The default value is 0. |
Methods
ArrangeOverride(SizeF)
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
|
Returns
System.Drawing.SizeF
|
Overrides
CreateChildElements()
Declaration
protected override void CreateChildElements()
Overrides
DisposeManagedResources()
Declaration
protected override void DisposeManagedResources()
Overrides
GetParameters()
Retrieves the srolling parameters.
Declaration
public ScrollBarParameters GetParameters()
Returns
ScrollBarParameters
|
See Also
GetVistaVisualStyle()
Declaration
public override VisualStyleElement GetVistaVisualStyle()
Returns
System.Windows.Forms.VisualStyles.VisualStyleElement
|
Overrides
GetXPVisualStyle()
Declaration
public override VisualStyleElement GetXPVisualStyle()
Returns
System.Windows.Forms.VisualStyles.VisualStyleElement
|
Overrides
InitializeFields()
InitializeSystemSkinPaint()
Declaration
protected override void InitializeSystemSkinPaint()
Overrides
MeasureOverride(SizeF)
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
|
Returns
System.Drawing.SizeF
|
Overrides
OnEnabledChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnEnabledChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
Overrides
OnLoaded()
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnPanGesture(PanGestureEventArgs)
Declaration
protected override void OnPanGesture(PanGestureEventArgs args)
Parameters
PanGestureEventArgs
args
|
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
Overrides
OnScroll(ScrollEventArgs)
Declaration
protected virtual void OnScroll(ScrollEventArgs args)
Parameters
System.Windows.Forms.ScrollEventArgs
args
|
OnScrollParameterChanged()
Declaration
protected virtual void OnScrollParameterChanged()
OnValueChanged()
Declaration
protected virtual void OnValueChanged()
OnValueChanged(Int32, Int32)
Declaration
protected virtual void OnValueChanged(int oldValue, int newValue)
Parameters
System.Int32
oldValue
|
System.Int32
newValue
|
PaintElementSkin(IGraphics)
Declaration
protected override void PaintElementSkin(IGraphics graphics)
Parameters
IGraphics
graphics
|
Overrides
PaintHorizontalVisualStylesElements()
Declaration
protected virtual void PaintHorizontalVisualStylesElements()
PaintVerticalVisualStyleElements()
Declaration
protected virtual void PaintVerticalVisualStyleElements()
PaintVisualStyleElement(Graphics, VisualStyleElement, Rectangle)
Declaration
protected virtual void PaintVisualStyleElement(Graphics graphics, VisualStyleElement element, Rectangle bounds)
Parameters
System.Drawing.Graphics
graphics
|
System.Windows.Forms.VisualStyles.VisualStyleElement
element
|
System.Drawing.Rectangle
bounds
|
PerformFirst()
Simulate scrolling with positioning the thumb on its first position. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformFirst()
PerformLargeDecrement(Int32)
Simulate scrolling - just like the top / left area according the thumb is pressed. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformLargeDecrement(int numSteps)
Parameters
System.Int32
numSteps
Value is decremented with (numSteps * LargeChange) |
PerformLargeIncrement(Int32)
Simulate scrolling - just like the bottom / right area according the thumb is pressed. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformLargeIncrement(int numSteps)
Parameters
System.Int32
numSteps
Value is incremented with (numSteps * LargeChange) |
PerformLast()
Simulate scrolling with positioning the thumb on its last position. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformLast()
PerformScrollTo(Point)
Scrolls just like the thumb is dragged at given position
Declaration
public void PerformScrollTo(Point position)
Parameters
System.Drawing.Point
position
Position of the thumb (in screen coordinates). |
PerformSmallDecrement(Int32)
Simulate scrolling - just like the top / left button is pressed. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformSmallDecrement(int numSteps)
Parameters
System.Int32
numSteps
Value is decremented with (numSteps * SmallChange) |
PerformSmallIncrement(Int32)
Simulate scrolling - just like the bottom / right button is pressed. Unlike setting property Value this function fires scrolling events.
Declaration
public void PerformSmallIncrement(int numSteps)
Parameters
System.Int32
numSteps
Value is incremented with (numSteps * SmallChange) |
SetParameters(ScrollBarParameters)
Sets the given scroll parameters.
Declaration
public void SetParameters(ScrollBarParameters parameters)
Parameters
ScrollBarParameters
parameters
|
See Also
ShouldPaintChild(RadElement)
Declaration
protected override bool ShouldPaintChild(RadElement element)
Parameters
RadElement
element
|
Returns
System.Boolean
|
Overrides
UnitializeSystemSkinPaint()
Declaration
protected override void UnitializeSystemSkinPaint()
Overrides
Events
Scroll
Occurs when the scroll thumb has been moved by either a mouse or keyboard action.
Declaration
public event ScrollEventHandler Scroll
Event Type
System.Windows.Forms.ScrollEventHandler
|
ScrollParameterChanged
Occurs when a property that affects the scrolling is changed. See ScrollBarParameters for more information on which properties affect the scrolling.
Declaration
public event EventHandler ScrollParameterChanged
Event Type
System.EventHandler
|
ValueChanged
Declaration
public event EventHandler ValueChanged
Event Type
System.EventHandler
|