CheckPrimitive
Represents a primitive element that renders checkboxes with support for checked, unchecked, and indeterminate states.
CheckPrimitive extends RadioPrimitive to provide checkbox-specific functionality, including support for three-state checkboxes (checked, unchecked, indeterminate) and various visual styles.
The primitive supports different rendering styles such as XP style, custom styles, and can be configured to draw fills and other visual enhancements. It's commonly used in checkbox controls, data grid cells, and other UI elements that require checkbox functionality.
Unlike radio buttons, checkboxes rendered by this primitive can be independently selected and support tri-state behavior when needed.
Definition
Namespace:Telerik.WinControls.Primitives
Assembly:Telerik.WinControls.dll
Syntax:
public class CheckPrimitive : RadioPrimitive, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode, IPrimitive, IFillElement, IPrimitiveElement, IShapedElement
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementBasePrimitiveFillPrimitiveRadioPrimitiveCheckPrimitive...
Implements:
Inherited Members
Constructors
public CheckPrimitive()
Fields
Identifies the drawing style used to construct the checkmark.
public static RadProperty CheckPrimitiveStyleProperty
Identifies the checkmark stroke thickness used when UseFixedCheckSize is disabled.
public static RadProperty CheckThicknessProperty
Identifies whether the inherited fill is painted before the checkmark.
public static RadProperty DrawFillProperty
Identifies the horizontal offset applied to the Win8-style indeterminate mark.
public static RadProperty HorizontalOffestProperty
Identifies the height adjustment for the Win8-style indeterminate mark when fixed-size mode is disabled.
public static RadProperty SquareHeightAdjustProperty
Identifies the width adjustment for the Win8-style indeterminate mark; fixed-size mode also uses it for height.
public static RadProperty SquareWidthAdjustProperty
Identifies whether the checkmark uses fixed dimensions or scales to the available client rectangle.
public static RadProperty UseFixedCheckSizeProperty
Identifies the vertical offset applied to the Win8-style indeterminate mark.
public static RadProperty VerticalOffestProperty
Properties
Gets or sets a value indicating the style of the check box primitive.
public CheckPrimitiveStyleEnum CheckPrimitiveStyle { get; set; }
Gets or sets the state used by the Win8-style checkmark renderer.
public ToggleState CheckState { get; set; }
The Win8 style draws no mark for Off, a checkmark for On, and a filled mark for Indeterminate. The XP, Vista, and Mac styles do not read this property.
Gets or sets a value that determines the checkmark thickness. Use this property only when UseFixedCheckSize property is set to false.
public int CheckThickness { get; set; }
Gets or sets a value indicating whether to draw the background.
public bool DrawFill { get; set; }
Gets or sets a value that determines how the checkmark position in Indeterminate will be adjusted horizontal (in pixels).
public int HorizontalOffest { get; set; }
Gets or sets a value that determines how the checkmark height in Indeterminate state will be adjusted (in pixels).
public int SquareHeightAdjust { get; set; }
Gets or sets a value that determines how the checkmark width in Indeterminate state will be adjusted (in pixels).
public int SquareWidthAdjust { get; set; }
Gets or sets a value that determines whether the checkmark size is fixed to 8;8 pixels.
public bool UseFixedCheckSize { get; set; }
Gets or sets a value that determines how the checkmark position in Indeterminate state will be adjusted vertical (in pixels).
public int VerticalOffest { get; set; }
Methods
Returns the rectangle inside the element's padding for the inherited fill renderer.
protected override Rectangle GetClientRect()
The padded client rectangle.
Overrides:
Paints the optional fill and the style-specific checkmark.
public override void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
The graphics context used to paint the fill and checkmark.
anglefloatThe accumulated angle passed to the base fill renderer when DrawFill is enabled.
scaleSizeFThe accumulated scale passed to the base fill renderer when DrawFill is enabled.
Overrides:
The checkmark geometry uses the element's DPI scale factor; the Win8 style also uses CheckState.