New to Telerik UI for WinFormsStart a free 30-day trial

BasePrimitive

Updated on Nov 5, 2025

BasePrimitive is a VisualElement descendant that implements the IPrimitive interface. IPrimitive adds a single boolean property ShouldPaint and a PaintPrimitive method that draws a primitive to the screen. Descendants of BasePrimitive override the PaintPrimitive method to represent some atomic visual component like text, fill, checkbox, arrows, etc. The following code is a sample PaintPrimitive method implementation for the TextPrimitive class:

C#
            
public override void PaintPrimitive(IGraphics graphics, float angle, SizeF scale)
{
    Rectangle rect = this.BoundingRectangle;
	graphics.DrawString(this.Text, rect, this.Font, this.ForeColor, this.CreateStringFormat(), this.TextOrientation, this.FlipText);
}

See Also

In this article
See Also
Not finding the help you need?
Contact Support