Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

LevelIndent Property, DimensionsClass Class

Defines the indentation for item levels.

Class: DimensionsClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

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

Value

The indentation in pixels.

The default value is 16.

Comments

Defines the indentation for item levels.

The specified width is the indentation for each level. If expand/collapse buttons (SftTree.ShowExpandCollapseButtons) or item images (ItemClass.Image) are shown, the indentation is the minimum indentation. Items are automatically indented more, to accommodate expand/collapse buttons or item images.

It is possible to specify a very small value or even 0 for the level indentation. With such a small value, the hierarchy and its components, such as tree lines, may no longer have sufficient space and must be turned off by the application.

Examples

C#

            m_PlusImage = Bitmap.FromFile("..\\..\\ExpandableNormal.bmp"); // a small + bitmap
            m_MinusImage = Bitmap.FromFile("..\\..\\CollapsableNormal.bmp"); // a small - bitmap
            Image img = Bitmap.FromFile("..\\..\\test.gif"); // a small sample bitmap

            // Most of this initialization code could be eliminated by designing the control.
            sftTree1.Initializing = true;
            sftTree1.Headers.Rows = 0;
            sftTree1.Footers.Rows = 0;
            sftTree1.Dimensions.LevelIndent = 5; // indent just a few pixels for level 1 items
            sftTree1.TreeLineStyle = TreeLineStyleEnum.None;
            sftTree1.ShowExpandCollapseButtons = ShowExpandCollapseButtonsEnum.None;
            sftTree1.RowHeaders.Width = 0;
            sftTree1.ShowFocusRectangle = false;
            sftTree1.ItemClick += sftTree1_ItemClick;
            sftTree1.ItemDoubleClick += sftTree1_ItemDoubleClick;
            sftTree1.ShowToolTip += new SftTree.ShowToolTipEventHandler(sftTree1_ShowToolTip);

VB.NET

    ' In addition, adjust the following FromFile methods to use a (small) bitmaps
    ' that are located on your system.
    Dim img As Image = Bitmap.FromFile("..\\..\\test.gif") ' a small sample bitmap

    ' Most of this initialization code could be eliminated by designing the control.
    sftTree1.Initializing = True
    sftTree1.Headers.Rows = 0
    sftTree1.Footers.Rows = 0
    sftTree1.Dimensions.LevelIndent = 5 ' indent just a few pixels for level 1 items
    sftTree1.TreeLineStyle = TreeLineStyleEnum.None
    sftTree1.ShowExpandCollapseButtons = ShowExpandCollapseButtonsEnum.None
    sftTree1.RowHeaders.Width = 0
    sftTree1.ShowFocusRectangle = False
    sftTree1.ToolTip.ShowAlways = True
    sftTree1.ToolTip.Style = ToolTipAppearanceEnum.Balloon

See Also DimensionsClass Class | Classes | SftTree/NET 2.0