Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

ShowFocusRectangle Property, SftTree Class

Defines whether the focus rectangle is shown for the current focus object.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

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

Value

True if the focus rectangle is shown, otherwise False.

The default value is True.

Comments

Defines whether the focus rectangle is shown for the current focus object.

The focus rectangle is only displayed if the tree control has the input focus. The size of the focus rectangle is consistent with the current selection style (SftTree.SelectionStyle).

If item selection is active, the focus object is an item (ItemClass), otherwise cell selection is active and the focus object is a cell.

The SftTree.FocusObject, SftTree.FocusItem and SftTree.FocusCell properties define the focus object.

Examples

C#

            // 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);
            sftTree1.ToolTip.ShowAlways = true;
            sftTree1.ToolTip.Style = ToolTipAppearanceEnum.Balloon;

            ItemClass cat;

VB.NET

    ' 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

    Dim cat As ItemClass
    cat = AddCategory("Category 1")
     AddItem(cat, img, "Item 1")
     AddItem(cat, img, "Item 2")

See Also SftTree Class | Classes | SftTree/NET 2.0