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 whether the item is expanded or collapsed.
Get
VB.NET | Boolean = object.Expanded As Boolean |
VB | Boolean = object.Expanded As Boolean |
C#.NET | bool Boolean = object.Expanded; |
VC++ | VARIANT_BOOL Boolean = object->Expanded; VARIANT_BOOL Boolean = object->GetExpanded(); |
C | HRESULT object->get_Expanded(VARIANT_BOOL* Boolean); |
Put
VB.NET | object.Expanded = Boolean As Boolean |
VB | object.Expanded = Boolean As Boolean |
C#.NET | bool object.Expanded = Boolean; |
VC++ | VARIANT_BOOL object->Expanded = Boolean; void object->PutExpanded(VARIANT_BOOL Boolean); |
C | HRESULT object->put_Expanded(VARIANT_BOOL Boolean); |
object
A SftTreeItem object.
Boolean
Defines whether the item is expanded or collapsed.
Boolean | Description |
---|---|
True | The item is expanded. |
False | The item is collapsed. |
The Expanded property defines whether the item is expanded or collapsed.
When setting Expanded to True, only an item's immediate dependents are made visible. Dependents of items that are made visible are not automatically made visible. The Items.Expand and Item.Expand method can be used to expand all immediate and indirect dependents.
If an item is already expanded when setting Expanded to True, the item remains unchanged. It does not hide any indirect dependents. To make sure that an item's indirect dependents are not shown, Expanded can be set to False first, which collapses the item (and all dependents), followed by setting Expanded to True. Now only immediate dependents are visible.
An item has to be currently shown to be expanded or collapsed. If the item is not shown, its state cannot be modified. The Item.Shown property can be used to determine if an item is shown.
The Item.DependentCount property can be used to determine if an item can be expanded. If an item doesn't have any dependents, it is a leaf item and cannot be expanded. However, it is not an error to use Expanded with a leaf item.
The Expanded property does not preserve or restore the expand/collapse state of its dependent items. Use Items.Expand, Item.Expand, Items.Collapse and Item.Collapse to preserve or restore this information.
If a parent item is collapsed, subsequently adding child items will automatically expand the item.
AxSftTree1.get_Header(2).Text = "Received" AxSftTree1.get_Header(3).Text = "Size" End If End Sub Private Sub AxSftTree1_ItemClick(ByVal sender As Object, ByVal e As AxSftTreeLib75._DSftTreeEvents_ItemClickEvent) Handles AxSftTree1.ItemClick Dim AreaType As Short = e.areaType If AreaType = SftTreeAreaTypeConstants.constSftTreeButton Then If (AxSftTree1.get_Item(e.itemIndex).Expanded) Then AxSftTree1.get_Item(e.itemIndex).Collapse(True) Else AxSftTree1.get_Item(e.itemIndex).Expand(True, False) End If ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeText Then ' edit description If e.colIndex = 1 Then
End Select End With End Sub Private Sub SftTree1_ItemClick(ByVal ItemIndex As Long, ByVal ColIndex As Integer, ByVal AreaType As Integer, ByVal Button As Integer, ByVal Shift As Integer) Dim Ascending As Boolean With SftTree1 If AreaType = constSftTreeButton Then If .Item(ItemIndex).Expanded Then .Item(ItemIndex).Collapse True Else .Item(ItemIndex).Expand True, False End If ElseIf AreaType = constSftTreeText Then ' edit description If ColIndex = 1 Then
axSftTree1.get_Header(2).Text = "Received"; axSftTree1.get_Header(3).Text = "Size"; } } private void axSftTree1_ItemClick(object sender, AxSftTreeLib75._DSftTreeEvents_ItemClickEvent e) { SftTreeAreaTypeConstants area = (SftTreeAreaTypeConstants) e.areaType; if (area == SftTreeAreaTypeConstants.constSftTreeButton) { if (axSftTree1.get_Item(e.itemIndex).Expanded) axSftTree1.get_Item(e.itemIndex).Collapse(true); else axSftTree1.get_Item(e.itemIndex).Expand(true, false); } else if (area == SftTreeAreaTypeConstants.constSftTreeText) { // edit description if (e.colIndex == 1) axSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0);
m_vTree->Header[2]->Text = _T("Received"); m_vTree->Header[3]->Text = _T("Size"); } } void CEmailDlg::OnItemClickSftTree1(long ItemIndex, short ColIndex, short AreaType, short Button, short Shift) { if (AreaType == constSftTreeButton) { if (m_vTree->Item[ItemIndex]->Expanded != VARIANT_FALSE) m_vTree->Item[ItemIndex]->Collapse(VARIANT_TRUE); else m_vTree->Item[ItemIndex]->Expand(VARIANT_TRUE, VARIANT_FALSE); } else if (AreaType == constSftTreeText) { // edit description if (ColIndex == 1) m_vTree->Cell[ItemIndex][ColIndex]->Edit(0, _variant_t(0L));
See Also SftTreeItem Object | Object Hierarchy