Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Initializing Property, SoftelvdmUserControl Class

Defines whether this control is initializing.

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

Syntax

public bool Initializing { get; set; }
Public Property Initializing As Boolean

Value

True if initializing, otherwise False.

The default value is False.

Comments

Defines whether this control is initializing.

Applications should use the Initializing property to signal that they intend to initialize the control or to apply significant updates and additions to the control.

Use of the Initializing property allows controls to significantly improve performance when changing many properties or when performing updates and additions to the control.

Initializing property is recommended as it increases performance significantly.

Examples

C#

            // a SftTree/NET control named sftTree1.
            // In addition, adjust the following FromFile methods to use a (small) bitmaps
            // that are located on your system.
            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;

VB.NET

    ' Visual Studio's Toolbox.
    ' To prepare for this sample, create a new project with a blank form and add
    ' a SftTree/NET control named sftTree1.
    ' 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

See Also SoftelvdmUserControl Class | Classes | SftTree/NET 2.0