New to Telerik UI for WinForms? Download free 30-day trial

ArrowPrimitive

The ArrowPrimitive draws a filled triangular polygon. Orientation is controlled by the Direction property with possible ArrowDirection enumeration values of Up, Down, Left or Right. The arrow is filled with the ForeColor property value. The example below draws a BorderPrimitive and an ArrowPrimitive.

tpf-primitives-arrowprimitive 001

Creating an ArrowPrimitive

public class MyArrowPrimitiveElement : RadElement
{
    protected override void CreateChildElements()
    {
        BorderPrimitive borderPrimitive = new BorderPrimitive();
        borderPrimitive.BoxStyle = BorderBoxStyle.OuterInnerBorders;
        borderPrimitive.Width = 1;
        borderPrimitive.GradientStyle = GradientStyles.Solid;
        borderPrimitive.ForeColor = Color.Blue;
        borderPrimitive.InnerColor = Color.Red;
        borderPrimitive.ZIndex = 1;
        ArrowPrimitive arrowPrimitive = new ArrowPrimitive();
        arrowPrimitive.Margin = new System.Windows.Forms.Padding(15);
        arrowPrimitive.StretchHorizontally = true;
        arrowPrimitive.StretchVertically = true;
        arrowPrimitive.Direction = ArrowDirection.Right;
        arrowPrimitive.ForeColor = Color.Blue;
        this.Children.Add(borderPrimitive);
        this.Children.Add(arrowPrimitive);
        base.CreateChildElements();
    }
}