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
Collapses the item so its dependents are no longer visible.
VB.NET | object.Collapse(ByVal Preserve As Boolean) |
VB | object.Collapse(ByVal Preserve As Boolean) |
C#.NET | void object.Collapse(bool Preserve); |
VC++ | HRESULT object->Collapse(VARIANT_BOOL Preserve); |
C | HRESULT object->raw_Collapse(VARIANT_BOOL Preserve); |
object
A SftTreeItem object.
Preserve
Defines whether the expand/collapse state is preserved.
Preserve | Description |
---|---|
True | Preserves the expand/collapse state of dependent items that are made no longer visible. A subsequent call to Items.Expand or Item.Expand will restore the items with the remembered expand/collapse state. |
False | The expand/collapse state is not preserved. |
The Collapse method collapses the item so its dependents are no longer visible.
The Collapse method collapses all dependent items of the item and saves the expand/collapse state of all dependent items, so it can be restored by a subsequent Items.Expand or Item.Expand method call.
If a parent item is collapsed, subsequently adding child items will automatically expand the item.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ItemIndex As Integer m_InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10) AddMessage(1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True) AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False) AddMessage(1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, True) AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False) ItemIndex = AxSftTree1.Items.ItemIndex(m_InboxFolder) AxSftTree1.get_Item(ItemIndex).Collapse(False) m_OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2) AddMessage(1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, False) AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False) ItemIndex = AxSftTree1.Items.ItemIndex(m_OutboxFolder) AxSftTree1.get_Item(ItemIndex).Collapse(False) m_SavedFolder = AddFolder("Saved", "Saved messages", 2) AddMessage(1, "me@mycompany.com", "A support question", "10/09/05", 3, False)
Private Sub Form_Load() With SftTree1 InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10) AddMessage 1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True AddMessage 1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False AddMessage 1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, True AddMessage 1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, False .Item(.Items.ItemIndex(InboxFolder)).Collapse False OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2) AddMessage 1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, False AddMessage 1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, False .Item(.Items.ItemIndex(OutboxFolder)).Collapse False SavedFolder = AddFolder("Saved", "Saved messages", 2) AddMessage 1, "me@mycompany.com", "A support question", "10/09/05", 3, False AddMessage 2, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, True AddMessage 3, "me@mycompany.com", "Re: A support question", "10/09/05", 3, False
private void Form1_Load(object sender, System.EventArgs e) { int ItemIndex; m_InboxFolder = AddFolder("Inbox", "Viewed and unviewed mail", 10); AddMessage(1, "support@softelvdm.com", "Re: A support question", "10/09/05", 88, true); AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, false); AddMessage(1, "anyone@acompany.com", "Re: You're fired", "10/11/05", 82, true); AddMessage(1, "anyone@acompany.com", "Re: You're hired", "10/11/05", 6, false); ItemIndex = axSftTree1.Items.get_ItemIndex(m_InboxFolder); axSftTree1.get_Item(ItemIndex).Collapse(false); m_OutboxFolder = AddFolder("Outbox", "Mail about to be sent", 2); AddMessage(1, "me@mycompany.com", "Re: You're fired", "10/11/05", 5, false); AddMessage(1, "anyone@acompany.com", "Re: Why did you say that", "10/10/05", 5, false); ItemIndex = axSftTree1.Items.get_ItemIndex(m_OutboxFolder); axSftTree1.get_Item(ItemIndex).Collapse(false); m_SavedFolder = AddFolder("Saved", "Saved messages", 2); AddMessage(1, "me@mycompany.com", "A support question", "10/09/05", 3, false);
m_pBoldCellFont->put_Bold(TRUE); m_InboxFolder = AddFolder(_T("Inbox"), _T("Viewed and unviewed mail"), 10); AddMessage(1, _T("support@softelvdm.com"), _T("Re: A support question"), _T("10/09/05"), 88, TRUE); AddMessage(1, _T("anyone@acompany.com"), _T("Re: Why did you say that"), _T("10/10/05"), 5, FALSE); AddMessage(1, _T("anyone@acompany.com"), _T("Re: You're fired"), _T("10/11/05"), 82, TRUE); AddMessage(1, _T("anyone@acompany.com"), _T("Re: You're hired"), _T("10/11/05"), 6, FALSE); m_vTree->Item[m_vTree->Items->ItemIndex[m_InboxFolder]]->Collapse(VARIANT_FALSE); m_OutboxFolder = AddFolder(_T("Outbox"), _T("Mail about to be sent"), 2); AddMessage(1, _T("me@mycompany.com"), _T("Re: You're fired"), _T("10/11/05"), 5, FALSE); AddMessage(1, _T("anyone@acompany.com"), _T("Re: Why did you say that"), _T("10/10/05"), 5, FALSE); m_vTree->Item[m_vTree->Items->ItemIndex[m_OutboxFolder]]->Collapse(VARIANT_FALSE); m_SavedFolder = AddFolder(_T("Saved"), _T("Saved messages"), 2); AddMessage(1, _T("me@mycompany.com"), _T("A support question"), _T("10/09/05"), 3, FALSE); AddMessage(2, _T("support@softelvdm.com"), _T("Re: A support question"), _T("10/09/05"), 88, TRUE);
See Also SftTreeItem Object | Object Hierarchy