RadScrollBarElement
Implements the basic functionality for scrolling.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[ComVisible(false)]
public class RadScrollBarElement : RadItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadScrollBarElement...
Implements:
Inherited Members
Constructors
public RadScrollBarElement()
Fields
public const ScrollType DefaultScrollType = Horizontal
Identifies the GradientAngleCorrection dependency property.
public static readonly RadProperty GradientAngleCorrectionProperty
Gets or sets the default height for horizontal scroll bars.
public static int HorizontalScrollBarHeight
Identifies the IsMouseOverScrollBar dependency property.
public static readonly RadProperty IsMouseOverScrollBarProperty
Identifies the MinThumbLength dependency property.
public static readonly RadProperty MinThumbLengthProperty
Identifies the Pressed dependency property.
public static readonly RadProperty PressedProperty
Identifies the ScrollType dependency property.
public static readonly RadProperty ScrollTypeProperty
Identifies the ThumbLengthProportion dependency property.
public static readonly RadProperty ThumbLengthProportionProperty
Gets or sets the default width for vertical scroll bars.
public static int VerticalScrollBarWidth
Properties
public BorderPrimitive BorderElement { get; }
Indicates whether invalid values should be clamped or an exception should be thrown
public bool ClampValue { get; set; }
public FillPrimitive FillElement { get; }
Gets the first button element of this scrollbar
public ScrollBarButton FirstButton { get; }
Controls the angle that the fill primitive will be rotated when switching from horizontal to vertical orientation
public float GradientAngleCorrection { get; set; }
Gets or sets a value to be added to or subtracted from the Value property when the scroll thumb is moved a large distance.
public int LargeChange { get; set; }
A numeric value. The default value is 10.
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.
Gets or sets the upper limit of the scrollable range.
public int Maximum { get; set; }
A numeric value. The default value is 100.
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.
Gets or sets the lower limit for the values of the scrollable range.
public int Minimum { get; set; }
A numeric value. The default value is 0.
Gets or sets the minimum length of the scrolling thumb. See ThumbLength for more information about thumb length.
public int MinThumbLength { get; set; }
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.
Gets or sets the scroll timer delay
[Browsable(false)]
public int ScrollTimerDelay { get; set; }
Gets or sets the ScrollType - it could be horizontal or vertical.
public ScrollType ScrollType { get; set; }
Gets the second button element of this scrollbar
public ScrollBarButton SecondButton { get; }
Gets or sets the value to be added to or subtracted from the Value property when the scroll thumb is moved a small distance.
public int SmallChange { get; set; }
A numeric value. The default value is 1.
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.
Gets the thumb element of this scrollbar
[Browsable(false)]
public ScrollBarThumb ThumbElement { get; }
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.
public int ThumbLength { get; }
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.
public double ThumbLengthProportion { get; set; }
Methods
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected override SizeF ArrangeOverride(SizeF finalSize)
The size that is available for element.
Returns:The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
Overrides:
In this method call to the Arrange method of each child must be made.
Called by the element when constructed. Allows inheritors to build the element tree.
protected override void CreateChildElements()
Overrides:
Releases managed resources used by this element.
protected override void DisposeManagedResources()
Overrides:
Retrieves the srolling parameters.
Gets the Vista visual style element for this scroll bar.
public override VisualStyleElement GetVistaVisualStyle()
The Vista visual style element.
Overrides:
Gets the XP visual style element for this scroll bar.
public override VisualStyleElement GetXPVisualStyle()
The XP visual style element.
Overrides:
Initializes the fields of this instance with their default values.
protected override void InitializeFields()
Overrides:
Performs initialization when the element is first-time painted using system skin.
protected override void InitializeSystemSkinPaint()
Overrides:
Measures the space required by the RadElement
Used by the layout system.
protected override SizeF MeasureOverride(SizeF availableSize)
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns:The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides:
In this method call to the Measure method of each child must be made.
Called when the element has been successfully loaded. That includes loading of all its children as well.
protected override void OnLoaded()
Overrides:
Called when a mouse button is pressed down over the item.
protected override void OnMouseDown(MouseEventArgs e)
The mouse event arguments.
Overrides:
Called when a mouse button is released over the item.
protected override void OnMouseUp(MouseEventArgs e)
The mouse event arguments.
Overrides:
Fires the PanGesture event.
protected override void OnPanGesture(PanGestureEventArgs args)
The arguments for the PanGesture event.
Overrides:
Called when a property value has changed, handling item-specific property change logic including text, visual state, and animation properties.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
Overrides:
protected virtual void OnScrollParameterChanged()
protected virtual void OnValueChanged()
Provides a routine to paint element's content when system skin appearance is desired.
protected override void PaintElementSkin(IGraphics graphics)
Overrides:
protected virtual void PaintHorizontalVisualStylesElements()
protected virtual void PaintVerticalVisualStyleElements()
protected virtual void PaintVisualStyleElement(Graphics graphics, VisualStyleElement element, Rectangle bounds)
Simulate scrolling with positioning the thumb on its first position. Unlike setting property Value this function fires scrolling events.
public void PerformFirst()
Simulate scrolling - just like the top / left area according the thumb is pressed. Unlike setting property Value this function fires scrolling events.
public void PerformLargeDecrement(int numSteps)
Value is decremented with (numSteps * LargeChange)
Simulate scrolling - just like the bottom / right area according the thumb is pressed. Unlike setting property Value this function fires scrolling events.
public void PerformLargeIncrement(int numSteps)
Value is incremented with (numSteps * LargeChange)
Simulate scrolling with positioning the thumb on its last position. Unlike setting property Value this function fires scrolling events.
public void PerformLast()
Scrolls just like the thumb is dragged at given position
public void PerformScrollTo(Point position)
Position of the thumb (in screen coordinates).
Simulate scrolling - just like the top / left button is pressed. Unlike setting property Value this function fires scrolling events.
public void PerformSmallDecrement(int numSteps)
Value is decremented with (numSteps * SmallChange)
Simulate scrolling - just like the bottom / right button is pressed. Unlike setting property Value this function fires scrolling events.
public void PerformSmallIncrement(int numSteps)
Value is incremented with (numSteps * SmallChange)
Sets the given scroll parameters.
public void SetParameters(ScrollBarParameters parameters)
protected override bool ShouldPaintChild(RadElement element)
Overrides:
Performs cleanup when system skin painting is no longer used.
protected override void UnitializeSystemSkinPaint()
Overrides:
Events
Occurs when the scroll thumb has been moved by either a mouse or keyboard action.
public event ScrollEventHandler Scroll
Occurs when a property that affects the scrolling is changed. See ScrollBarParameters for more information on which properties affect the scrolling.
public event EventHandler ScrollParameterChanged