Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

VisibleIndex Property, ItemClass Class

Returns the index of the item.

Class: ItemClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public int VisibleIndex { get; }
Public ReadOnly Property VisibleIndex As Integer

Value

The index of the item or -1 if this item is not visible.

Comments

Returns the index of the item.

This is normally only used internally by the control. A visible item count is used with scrolling operations. Scroll bar ranges are based on visible items only.

Examples

C#

            sftTree1.Initializing = false;
        }

        // ItemClick event
        private void sftTree1_ItemClick(object sender, ItemClickEventArgs e) {
            Debug.Write("** ItemClick");
            int itemIndex = -1;
            if (e.Item != null) 
                itemIndex = e.Item.VisibleIndex;
            if (itemIndex >= 0)
                Debug.Write(" Row " + itemIndex.ToString());
            int colIndex = -1;
            if (e.Cell != null)
                colIndex = e.Cell.ColumnIndex;
            if (colIndex >= 0)
                Debug.Write(" Column " + colIndex.ToString());

VB.NET

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

' ItemClick event
Private Sub sftTree1_ItemClick(ByVal sender As Object, ByVal e As Softelvdm.SftTreeNET.ItemClickEventArgs) Handles sftTree1.ItemClick
    Debug.Write("** ItemClick")
    Dim itemIndex As Integer = -1
    If Not e.Item Is Nothing Then itemIndex = e.Item.VisibleIndex
    If itemIndex >= 0 Then
        Debug.Write(" Row " & itemIndex.ToString())
    End If
    Dim colIndex As Integer = -1
    If Not e.Cell Is Nothing Then colIndex = e.Cell.ColumnIndex
    If colIndex >= 0 Then
        Debug.Write(" Column " + colIndex.ToString())

See Also ItemClass Class | Classes | SftTree/NET 2.0