Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

PartOwner Property, GenericPartClass Class

Returns the owner of the part, usually an object derived from CellBaseClass.

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

Syntax

public object PartOwner { get; }
Public ReadOnly Property PartOwner As Object

Value

The part owner.

Comments

Returns the owner of the part, usually an object derived from CellBaseClass.

Examples

C#

            MessageBox.Show("Dropdown button clicked.");
        }

        // Button part Action event
        void bp_Action(object sender, ActionEventArgs e) {
            // this is our button that was just clicked
            ButtonPartClass bp = (ButtonPartClass)e.Part;
            // 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)

VB.NET

    MessageBox.Show("Dropdown button clicked.")
End Sub

' Button part Action event
Private Sub bp_Action(ByVal sender As Object, ByVal e As ActionEventArgs)
    ' 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

See Also GenericPartClass Class | Classes | SftTree/NET 2.0