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
Expands the item so its dependents become visible.
VB.NET | object.Expand(ByVal Preserve As Boolean, ByVal Depth As Boolean) |
VB | object.Expand(ByVal Preserve As Boolean, ByVal Depth As Boolean) |
C#.NET | void object.Expand(bool Preserve, bool Depth); |
VC++ | HRESULT object->Expand(VARIANT_BOOL Preserve, VARIANT_BOOL Depth); |
C | HRESULT object->raw_Expand(VARIANT_BOOL Preserve, VARIANT_BOOL Depth); |
object
A SftTreeItem object.
Preserve
Defines whether the expand/collapse state is restored. This argument is ignored if the Depth argument is True.
Preserve | Description |
---|---|
True | Restores the expand/collapse state of dependent items made visible, as saved by a previous call to Items.Collapse or Item.Collapse. |
False | The expand/collapse state is not restored. Only the item itself is expanded and immediate dependents are made visible. They may be expanded or collapsed based on the Depth argument. |
Depth
Defines the depth of the items to become visible.
Depth | Description |
---|---|
True | Expands all dependent items, including non-immediate dependent items. Preserve is ignored as all dependents are expanded. |
False | Expands dependent items, based on the Preserve settings. |
The Expand method expands the item so its dependents become visible.
The Expand method expands all dependent items of the item and restores the expand/collapse state of all dependent items, as saved by a previous Items.Collapse or Item.Collapse method call.
If the item is already expanded when using Expand, the item remains unchanged. It does not make any indirect dependents visible. To make sure that an item's indirect dependents are shown, use the Item.Collapse method first, which collapses the item (and all dependents), followed by Expand. Now all dependents are visible.
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
AxSftTree1.get_Cell(e.itemIndex, e.colIndex).Edit(0, 0)
End If
ElseIf AreaType = SftTreeAreaTypeConstants.constSftTreeColumn Then
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
.Cell(ItemIndex, ColIndex).Edit 0, 0
End If
ElseIf AreaType = constSftTreeColumn Then
Dim SortedColumn As Integer
}
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);
} else if (area == SftTreeAreaTypeConstants.constSftTreeColumn) {
short sortedColumn = axSftTree1.Headers.SortedColumn;
if (sortedColumn >= 0) {
}
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));
} else if (AreaType == constSftTreeColumn) {
int sortedColumn = m_vTree->Headers->SortedColumn;
if (sortedColumn >= 0) {
See Also SftTreeItem Object | Object Hierarchy