Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Appearance Property, CellBaseClass Class

Defines the background appearance of the cell.

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

Syntax

public BackgroundAppearanceEnum Appearance { get; set; }
Public Property Appearance As BackgroundAppearanceEnum

Value

The background appearance.

The default value is BackgroundAppearanceEnum.Default.

Comments

Defines the background appearance of the cell.

The default background appearance can be defined using these properties: RowHeadersClass.AppearanceDefault for row headers, HeadersClass.AppearanceDefault for column headers and FootersClass.AppearanceDefault for column footers. The default for items is BackgroundAppearanceEnum.Clean and cannot be changed.

The CellBaseClass.EvaluatedAppearance property can be used to determine the actual background appearance for this cell by evaluating the default settings.

Examples

C#

            sftTree1.Columns.MakeOptimal(0, false);
            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();

VB.NET

    sftTree1.Columns.MakeOptimal(0, False)
    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)

See Also CellBaseClass Class | Classes | SftTree/NET 2.0