Export (0) Print
Expand All

CheckBoxRenderer Class

Provides methods used to render a check box control with or without visual styles. This class cannot be inherited.

System.Object
  System.Windows.Forms.CheckBoxRenderer

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

[<Sealed>]
type CheckBoxRenderer =  class end

The CheckBoxRenderer type exposes the following members.

  NameDescription
Public propertyStatic memberRenderMatchingApplicationStateGets or sets a value indicating whether the renderer uses the application state to determine rendering style.
Top

  NameDescription
Public methodStatic memberDrawCheckBox(Graphics, Point, CheckBoxState)Draws a check box control in the specified state and location.
Public methodStatic memberDrawCheckBox(Graphics, Point, Rectangle, String, Font, Boolean, CheckBoxState)Draws a check box control in the specified state and location, with the specified text, and with an optional focus rectangle.
Public methodStatic memberDrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Boolean, CheckBoxState)Draws a check box control in the specified state and location, with the specified text and text formatting, and with an optional focus rectangle.
Public methodStatic memberDrawCheckBox(Graphics, Point, Rectangle, String, Font, Image, Rectangle, Boolean, CheckBoxState)Draws a check box control in the specified state and location, with the specified text and image, and with an optional focus rectangle.
Public methodStatic memberDrawCheckBox(Graphics, Point, Rectangle, String, Font, TextFormatFlags, Image, Rectangle, Boolean, CheckBoxState)Draws a check box control in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle.
Public methodStatic memberDrawParentBackgroundDraws the background of a control's parent in the specified area.
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 methodStatic memberGetGlyphSizeReturns the size of the check box glyph.
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberIsBackgroundPartiallyTransparentIndicates whether the background of the check box has semitransparent or alpha-blended pieces.
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 CheckBoxRenderer class provides a set of static methods that can be used to render a check box control. Rendering a control refers to drawing the user interface of a control. To draw a check box, use one of the DrawCheckBox methods. These methods provide a variety of options, such as drawing text or an image with the check box.

If visual styles are enabled in the operating system and visual styles are applied to the current application, DrawCheckBox will draw the check box with the current visual style. Otherwise, DrawCheckBox will draw the check box with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system.

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.Button.CheckBox 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 write a custom control that uses the DrawCheckBox method to draw a check box 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:
© 2015 Microsoft