Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Value Property, ProgressBarPartClass Class

Defines the progressbar's current position.

Class: ProgressBarPartClass
Namespace: Softelvdm.Controls
Assembly: Softelvdm.SftTreeNET

Syntax

public int Value { get; set; }
Public Property Value As Integer

Value

The minimum value.

The default value is 50.

Comments

Defines the progressbar's current position.

A progressbar displays a gauge defined by the minimum and maximum values ProgressBarPartClass.Min and ProgressBarPartClass.Max, with the current position Value. The Value property must always be between ProgressBarPartClass.Min and ProgressBarPartClass.Max.

Examples

C#

            // this is the cell containing the button
            CellClass cell = (CellClass)bp.PartOwner;
            // get the previous cell
            cell = cell.Previous; 
            // this cell's first (and only) part is a progressbar (in this example)
            ProgressBarPartClass pbp = (ProgressBarPartClass) cell.Parts[0];
            // increment the progressbar's Value property
            int val;
            if (pbp.Value == pbp.Max)
                val = 0;
            else
                val = pbp.Value + 10;
            val = Math.Min(val, pbp.Max);
            pbp.Value = val;
        }

VB.NET

    ' this is our button that was just clicked
    Dim bp As ButtonPartClass = e.Part
    ' this is the cell containing the button
    Dim cell As CellClass = bp.PartOwner
    ' get the previous cell
    cell = cell.Previous
    ' this cell's first (and only) part is a progressbar (in this example)
    Dim pbp As ProgressBarPartClass = cell.Parts(0)
    ' increment the progressbar's Value property
    Dim Val As Integer
    If pbp.Value = pbp.Max Then
        Val = 0
    Else
        Val = pbp.Value + 10
    End If
    Val = Math.Min(Val, pbp.Max)

See Also ProgressBarPartClass Class | Classes | SftTree/NET 2.0



Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.