Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

NextSibling Property, SftTreeItem Object

Returns the item's next sibling.

Syntax

Get

VB.NETItemIndex = object.NextSibling As Integer
VBItemIndex = object.NextSibling As Long
C#.NETint ItemIndex = object.NextSibling;
VC++long ItemIndex = object->NextSibling;
long ItemIndex = object->GetNextSibling();
CHRESULT object->get_NextSibling(long* ItemIndex);

object

A SftTreeItem object.

ItemIndex

Returns the item's next sibling. -1 is returned if the item doesn't have a next sibling.

Comments

The NextSibling property returns the item's next sibling.

The next sibling of the item is found by scanning towards the end of the tree control and locating an item on the same level (Item.Level property) as the item without encountering a parent item.

The Item.PrevSibling property can be used to retrieve an item's previous sibling. The Item.FirstSibling and Item.LastSibling properties can be used to retrieve an item's first or last sibling.

Examples

VB.NET

                            End If
                        Else
                            If SortedColumn = 3 Then
                                AxSftTree1.Items.SortDependents(ItemIndex, SortedColumn, SftTreeSortTypeConstants.sortSftTreeDscCellItemData)
                            Else
                                AxSftTree1.Items.SortDependents(ItemIndex, SortedColumn, SftTreeSortTypeConstants.sortSftTreeDescending)
                            End If
                        End If
                        ItemIndex = AxSftTree1.get_Item(ItemIndex).NextSibling
                    Loop While ItemIndex >= 0
                End If
                ' update column headers by calling CaretChange
                AxSftTree1_CaretChange(Me, New _DSftTreeEvents_CaretChangeEvent(AxSftTree1.Items.Current))
            End If
        End If
    End Sub

VB6

                            End If
                        Else
                            If SortedColumn = 3 Then
                                .Items.SortDependents ItemIndex, SortedColumn, sortSftTreeDscCellItemData
                            Else
                                .Items.SortDependents ItemIndex, SortedColumn, sortSftTreeDescending
                            End If
                        End If
                        ItemIndex = .Item(ItemIndex).NextSibling
                    Loop Until ItemIndex < 0

                End Select
                SftTree1_CaretChange .Items.Current
            End If
        End If
    End With

C#

                                else
                                    axSftTree1.Items.SortDependents(ItemIndex, sortedColumn, SftTreeSortTypeConstants.sortSftTreeAscending);
                            } else {
                                if (sortedColumn == 3)
                                    axSftTree1.Items.SortDependents(ItemIndex, sortedColumn, SftTreeSortTypeConstants.sortSftTreeDscCellItemData);
                                else
                                    axSftTree1.Items.SortDependents(ItemIndex, sortedColumn, SftTreeSortTypeConstants.sortSftTreeDescending);
                            }
                            ItemIndex = axSftTree1.get_Item(ItemIndex).NextSibling;
                        } while (ItemIndex >= 0);
                    }
                    // update column headers by calling CaretChange
                    axSftTree1_CaretChange(this, new _DSftTreeEvents_CaretChangeEvent(axSftTree1.Items.Current));
                }
            }
        }

C++

                        else
                            m_vTree->Items->SortDependents(ItemIndex, sortedColumn, sortSftTreeAscending);
                    } else {
                        if (sortedColumn == 3)
                            m_vTree->Items->SortDependents(ItemIndex, sortedColumn, sortSftTreeDscCellItemData);
                        else
                            m_vTree->Items->SortDependents(ItemIndex, sortedColumn, sortSftTreeDescending);
                    }
                    ItemIndex = m_vTree->Item[ItemIndex]->NextSibling;
                } while (ItemIndex >= 0);
            }
        }
        // update column headers by calling CaretChange
        OnCaretChangeSftTree1(m_vTree->Items->Current);
    }
}

See Also SftTreeItem Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2023 Softel vdm, Inc.