Defines the current item (caret location).
Get
| C# | int ItemIndex = object.Current; |
| VB.NET | ItemIndex = object.Current As Integer |
| C++ | long ItemIndex = object->Current; long ItemIndex = object->GetCurrent(); |
| C | HRESULT object->get_Current(long* ItemIndex); |
| VB | ItemIndex = object.Current As Long |
Put
| C# | int object.Current = ItemIndex; |
| VB.NET | object.Current = ItemIndex As Integer |
| C++ | long object->Current = ItemIndex; void object->PutCurrent(long ItemIndex); |
| C | HRESULT object->put_Current(long ItemIndex); |
| VB | object.Current = ItemIndex As Long |
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
this.WindowState = FormWindowState.Maximized;
}
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
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
}
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 upSee Also SftTreeItems Object | Object Hierarchy