Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

TopIndex Property, SftTreeItems Object

Defines the index of the first item displayed in the tree control's client area.

Syntax

Get

VB.NETItemIndex = object.TopIndex As Integer
VBItemIndex = object.TopIndex As Long
C#.NETint ItemIndex = object.TopIndex;
VC++long ItemIndex = object->TopIndex;
long ItemIndex = object->GetTopIndex();
CHRESULT object->get_TopIndex(long* ItemIndex);

Put

VB.NETobject.TopIndex = ItemIndex As Integer
VBobject.TopIndex = ItemIndex As Long
C#.NETint object.TopIndex = ItemIndex;
VC++long object->TopIndex = ItemIndex;
void object->PutTopIndex(long ItemIndex);
CHRESULT object->put_TopIndex(long ItemIndex);

object

A SftTreeItems object.

ItemIndex

Defines the index of the first item displayed in the tree control's client area.

Comments

The TopIndex property defines the index of the first item displayed in the tree control's client area.

The Item.MakeVisible method can be used to insure that an item is displayed anywhere in the tree control area. The TopIndex property is used to make the item specified the very first item shown in the tree control area.

Examples

VB.NET

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        m_PicCount = 0
        AxSftTree1.VirtualMode = True
        AxSftTree1.VirtualCount(10000000)
        AxSftTree1.VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16)
        ' Make columns and row headers optimal
        ' but do this at the end of the list, because our sample
        ' data is larger at the end
        AxSftTree1.Items.TopIndex = AxSftTree1.Items.Count - 1
        AxSftTree1.ColumnsObj.MakeOptimal()
        AxSftTree1.RowHeaders.MakeOptimal()
        AxSftTree1.Items.RecalcHorizontalExtent()
        AxSftTree1.Items.TopIndex = 0
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick

VB6

    PicCount = 0
    With SftTree1
        .VirtualMode = True
        .VirtualCount 10000000
        .VirtualImageSizes 16, 16, 16, 16, 16, 16, 16, 16
        ' Make columns and row headers optimal
        ' but do this at the end of the list, because our sample
        ' data is larger at the end
        .Items.TopIndex = .Items.Count - 1
        .ColumnsObj.MakeOptimal
        .RowHeaders.MakeOptimal
        .Items.RecalcHorizontalExtent
        .Items.TopIndex = 0
    End With
End Sub

C#

        private void Form1_Load(object sender, System.EventArgs e) {
            m_PicCount = 0;
            axSftTree1.VirtualMode = true;
            axSftTree1.VirtualCount(10000000);
            axSftTree1.VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16);
            // Make columns and row headers optimal
            // but do this at the end of the list, because our sample
            // data is larger at the end
            axSftTree1.Items.TopIndex = axSftTree1.Items.Count - 1;
            axSftTree1.ColumnsObj.MakeOptimal();
            axSftTree1.RowHeaders.MakeOptimal();
            axSftTree1.Items.RecalcHorizontalExtent();
            axSftTree1.Items.TopIndex = 0;
       }

        private void Timer1_Tick(object sender, System.EventArgs e) {

C++

    ASSERT(m_vTree != NULL);

    m_vTree->VirtualMode = VARIANT_TRUE;
    m_vTree->VirtualCount(10000000);
    m_vTree->VirtualImageSizes(16, 16, 16, 16, 16, 16, 16, 16);
    // Make columns and row headers optimal
    // but do this at the end of the list, because our sample
    // data is larger at the end
    m_vTree->Items->TopIndex = m_vTree->Items->Count - 1;
    m_vTree->ColumnsObj->MakeOptimal();
    m_vTree->RowHeaders->MakeOptimal();
    m_vTree->Items->RecalcHorizontalExtent();
    m_vTree->Items->TopIndex = 0;

    SetTimer(TIMER_ID, 100, NULL);

See Also SftTreeItems Object | Object Hierarchy


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