SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines the current item (caret location).
Get
| VB.NET | ItemIndex = object.Current As Integer | 
| VB | ItemIndex = object.Current As Long | 
| C#.NET | int ItemIndex = object.Current; | 
| VC++ | long ItemIndex = object->Current; long ItemIndex = object->GetCurrent(); | 
| C | HRESULT object->get_Current(long* ItemIndex); | 
Put
| VB.NET | object.Current = ItemIndex As Integer | 
| VB | object.Current = ItemIndex As Long | 
| C#.NET | int object.Current = ItemIndex; | 
| VC++ | long object->Current = ItemIndex; void object->PutCurrent(long ItemIndex); | 
| C | HRESULT object->put_Current(long ItemIndex); | 
object
A SftTreeItems object.
ItemIndex
Defines the current item (caret location).
The Current property defines the current item (caret location).
The Current property describes the current item, which is the item that has the focus rectangle. This item is not necessarily also selected. The current item is described by the Current property, the currently selected item is described by the Items.Selection property. These are not necessarily the same even in a single-selection tree control (see Items.NoSelection property).
When the user changes the current item (caret location), the CaretChange event occurs. The SelectionChange event occurs when the selection changes.
If the tree control is empty, the Current property returns -1. An application must set the property to a valid, existing item. It cannot set it to -1.
The focus rectangle can be hidden using the Items.ShowFocusRectangle property.
    AxSftTree1.RowHeaders.MakeOptimal() ' Make row header width optimal, so text and pictures are not clipped horizontally.
    AxSftTree1.ColumnsObj.MakeOptimal() ' Make all columns optimal
    ' triple the size of the last column
    AxSftTree1.get_Column(1).WidthPix = AxSftTree1.get_Column(1).WidthPix * 3
    AxSftTree1.Items.RecalcHorizontalExtent() ' Update horizontal scrollbar
    AxSftTree1.Items.Current = 0 ' select the first item
    AxSftTree1.get_Item(0).Selected = True
    AxSftTree1.Dock = DockStyle.Fill ' Maximize the main window
    Me.WindowState = FormWindowState.Maximized
End Sub
    SftTree1.Item(6).Cell(1).AttachContentWindow SavedForm.hWnd, contentWindowSftTreeKeepSize
    SftTree1.Item(6).Cell(1).Text = ""
    ' triple the size of the last column
    SftTree1.Column(1).WidthPix = SftTree1.Column(1).WidthPix * 3
    SftTree1.Items.RecalcHorizontalExtent ' Update horizontal scrollbar
    SftTree1.Items.Current = 0 ' select the first item
    SftTree1.Item(0).Selected = True
    Me.WindowState = 2 ' Maximize the main window
End Sub
Private Sub Form_Unload(Cancel As Integer)
    ' clean up
            axSftTree1.RowHeaders.MakeOptimal(); // Make row header width optimal, so text and pictures are not clipped horizontally.
            axSftTree1.ColumnsObj.MakeOptimal(); // Make all columns optimal
            // triple the size of the last column
            axSftTree1.get_Column(1).WidthPix = axSftTree1.get_Column(1).WidthPix * 3;
            axSftTree1.Items.RecalcHorizontalExtent(); // Update horizontal scrollbar
            axSftTree1.Items.Current = 0; // select the first item
            axSftTree1.get_Item(0).Selected = true;
            axSftTree1.Dock = DockStyle.Fill; // Maximize the main window
            this.WindowState = FormWindowState.Maximized;
        }
    m_vTree->RowHeaders->MakeOptimal(); // Make row header width optimal, so text and pictures are not clipped horizontally.
    m_vTree->ColumnsObj->MakeOptimal(); // Make all columns optimal
    // triple the size of the last column
    m_vTree->Column[1]->WidthPix = m_vTree->Column[1]->WidthPix * 3;
    m_vTree->Items->RecalcHorizontalExtent(); // Update horizontal scrollbar
    m_vTree->Items->Current = 0; // select the first item
    m_vTree->Item[0]->Selected = VARIANT_TRUE;
    SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
    return TRUE;  // return TRUE  unless you set the focus to a control
}
See Also SftTreeItems Object | Object Hierarchy
