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

ProgressBarPrimitive

Updated over 6 months ago

ProgressBarPrimitive is a specialized descendant of the FillPrimitive that indicates the state of progress in a long running process. The fill area is controlled by the GradientStyle and the BackColor.BackColor4 properties. The fill covers the percentage area between Minimum and Maximum specified by the Value1 property. Value1 is rendered using up to all four colors. Value2 displays in the BackColor at 25% opacity. Orientation controls the starting point of the fill and can originate from Left, Right, Top or Bottom. The example below shows a Linear fill for Value1(set to 20), and a pale Aqua for Value2(set to 70).

tpf-primitives-progressprimitive 001

Creating a ProgressBarPrimitive

C#
public class MyProgressBarPrimitiveElement : RadElement
{
    protected override void CreateChildElements()
    {
        BorderPrimitive borderPrimitive = new BorderPrimitive();
        borderPrimitive.BoxStyle = BorderBoxStyle.OuterInnerBorders;
        borderPrimitive.GradientStyle = GradientStyles.Solid;
        borderPrimitive.ForeColor = Color.Blue;
        borderPrimitive.InnerColor = Color.LightSkyBlue;  
        ProgressBarPrimitive progressBarPrimitive = new ProgressBarPrimitive();
        progressBarPrimitive.GradientStyle = GradientStyles.Linear;
        progressBarPrimitive.NumberOfColors = 4;
        progressBarPrimitive.Orientation = ProgressOrientation.Left;
        progressBarPrimitive.Value1 = 20;
        progressBarPrimitive.Value2 = 70;
        progressBarPrimitive.Minimum = 1;
        progressBarPrimitive.Maximum = 100;
        progressBarPrimitive.BackColor = Color.Aqua;
        progressBarPrimitive.BackColor2 = Color.Blue;
        progressBarPrimitive.BackColor3 = Color.SkyBlue;
        progressBarPrimitive.BackColor4 = Color.LightSkyBlue;
        borderPrimitive.ZIndex = 1;
        this.Children.Add(borderPrimitive);
        this.Children.Add(progressBarPrimitive);
        base.CreateChildElements();
    }
}

See Also

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