Edit this page

FocusPrimitive

FocusPrimitive supplies user interface cues that an element has received focus. The constructor for FocusPrimitive takes a BorderPrimitive that provides the basic dimensions. Fore colors and inner colors may be set explicitly or default control colors are used.

tpf-primitives-focusprimitive 001

Creating a FocusPrimitive

public class MyFocusPrimitiveElement : RadElement
{
    protected override void CreateChildElements()
    {
        BorderPrimitive borderPrimitive = new BorderPrimitive();
        borderPrimitive.Class = "MyBorderPrimtiveClass";
        borderPrimitive.BoxStyle = BorderBoxStyle.SingleBorder;
        borderPrimitive.Width = 3;
        borderPrimitive.ForeColor = Color.Red;
        borderPrimitive.GradientStyle = GradientStyles.Solid;
        FocusPrimitive focusPrimitive = new FocusPrimitive(borderPrimitive);
        this.Children.Add(borderPrimitive);
        this.Children.Add(focusPrimitive);
        base.CreateChildElements();
    }
}

Public Class MyFocusPrimitiveElement
    Inherits RadElement
    Protected Overrides Sub CreateChildElements()
        Dim borderPrimitive As New BorderPrimitive()
        borderPrimitive.Class = "MyBorderPrimtiveClass"
        borderPrimitive.BoxStyle = BorderBoxStyle.SingleBorder
        borderPrimitive.Width = 3
        borderPrimitive.ForeColor = Color.Red
        borderPrimitive.GradientStyle = GradientStyles.Solid
        Dim focusPrimitive As New FocusPrimitive(borderPrimitive)
        Me.Children.Add(borderPrimitive)
        Me.Children.Add(focusPrimitive)
        MyBase.CreateChildElements()
    End Sub
End Class

See Also

Was this article helpful? Yes No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy