Export (0) Print
Expand All

ScrollBarRenderer Class

Provides methods used to render a scroll bar control with visual styles. This class cannot be inherited.

System.Object
  System.Windows.Forms.ScrollBarRenderer

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<Sealed>]
type ScrollBarRenderer =  class end

The ScrollBarRenderer type exposes the following members.

  NameDescription
Public propertyStatic memberIsSupportedGets a value indicating whether the ScrollBarRenderer class can be used to draw a scroll bar with visual styles.
Top

  NameDescription
Public methodStatic memberDrawArrowButtonDraws a scroll arrow with visual styles.
Public methodStatic memberDrawHorizontalThumbDraws a horizontal scroll box (also known as the thumb) with visual styles.
Public methodStatic memberDrawHorizontalThumbGripDraws a grip on a horizontal scroll box (also known as the thumb) with visual styles.
Public methodStatic memberDrawLeftHorizontalTrackDraws a horizontal scroll bar track with visual styles.
Public methodStatic memberDrawLowerVerticalTrackDraws a vertical scroll bar track with visual styles.
Public methodStatic memberDrawRightHorizontalTrackDraws a horizontal scroll bar track with visual styles.
Public methodStatic memberDrawSizeBoxDraws a scroll bar sizing handle with visual styles.
Public methodStatic memberDrawUpperVerticalTrackDraws a vertical scroll bar track with visual styles.
Public methodStatic memberDrawVerticalThumbDraws a vertical scroll box (also known as the thumb) with visual styles.
Public methodStatic memberDrawVerticalThumbGripDraws a grip on a vertical scroll box (also known as the thumb) with visual styles.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodStatic memberGetSizeBoxSizeReturns the size of the sizing handle.
Public methodStatic memberGetThumbGripSizeReturns the size of the scroll box grip.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The ScrollBarRenderer class provides a set of static methods that can be used to render a scroll bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a scroll bar, use a combination of the methods in this class to render each part of the scroll bar.

If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the scroll bar with the current visual style. Otherwise, the methods of this class will throw an InvalidOperationException. To determine whether the members of this class can be used, you can check the value of the IsSupported property.

This class wraps the functionality of a System.Windows.Forms.VisualStyles.VisualStyleRenderer that is set to one of the elements exposed by the System.Windows.Forms.VisualStyles.VisualStyleElement.ScrollBar class. For more information, see Rendering Controls with Visual Styles.

Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003 Platform Note: Visual styles are supported only on these platforms.

The following code example demonstrates how to create a custom control that uses the ScrollBarRenderer methods to draw a scroll bar that responds to mouse clicks.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft