Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Parts Property, CellBaseClass Class

Returns the cell's parts collection.

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

Syntax

public PartsCollectionClass Parts { get; }
Public ReadOnly Property Parts As PartsCollectionClass

Value

The parts collection.

Comments

Returns the cell's parts collection.

The cell contents consists of any number of parts.

These parts are currently available: Text (TextPartClass), images (ImagePartClass), gaps for additional spacing (GapPartClass) checkboxes (CheckBoxPartClass), radiobuttons (RadioButtonPartClass), push buttons (ButtonPartClass), dropdown buttons (DropDownButtonPartClass), progressbars (ProgressBarPartClass).

Additional application-defined parts can be implemented by deriving a new class from the GenericPartClass class.

Parts can be added and removed using the methods defined by the PartsCollectionClass class.

Examples

C#

            sftTree1.RecalcHorizontalExtent();
            sftTree1.Initializing = false;
        }

        private ItemClass AddCategory(string Category) {
            ItemClass item = sftTree1.ItemCollection.Add();
            CellClass cell = item.Cells[0];
            cell.Appearance = BackgroundAppearanceEnum.ThemedSystemHeaderNeverPressed;
            cell.Parts.Add(new ImagePartClass(m_PlusImage));
            cell.Parts.Add(new TextPartClass(Category));
            item.TagString = "This is a tooltip explaining " + Category;
            return item;
        }
        private void AddItem(ItemClass cat, Image img, string ItemText) {
            ItemClass item = cat.Add();
            CellClass cell = item.Cells[0];

VB.NET

    sftTree1.RecalcHorizontalExtent()
    sftTree1.Initializing = False
End Sub

Private Function AddCategory(ByVal Category As String) As ItemClass
    Dim item As ItemClass = sftTree1.ItemCollection.Add()
    Dim cell As CellClass = item.Cells(0)
    cell.Appearance = BackgroundAppearanceEnum.ThemedSystemHeaderNeverPressed
    cell.Parts.Add(New ImagePartClass(m_PlusImage))
    cell.Parts.Add(New TextPartClass(Category))
    item.TagString = "This is a tooltip explaining " & Category
    Return item
End Function

Private Sub AddItem(ByVal cat As ItemClass, ByVal img As Image, ByVal ItemText As String)
    Dim item As ItemClass = cat.Add()

See Also CellBaseClass Class | Classes | SftTree/NET 2.0