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
Depending on the programming language used, the steps necessary to add a tree control to an application differ somewhat, but the following steps outline the basic method:
First, a tree control is added to a dialog using a resource editor (see "Creating a Dialog Resource"). When the dialog is later used in an application, the tree control is automatically created and can be accessed using the supplied API. A tree control can also be created outside of a dialog. This is documented in the language specific programming sections "Using C" and "Using C++/MFC".
Once the tree control has been created, the API functions documented in sections "C/C++ API" and "C/C++ API (By Category)" can be used to add items, define attributes, enable tree components, etc. The following samples create a very minimal tree control with three items as pictured below. This example can easily be extended by adding a few calls to define item pictures and other tree components to change the appearance of the tree control.
Note: SftTree/DLL Wizard should be used to design the tree control look. With the SftTree/DLL Wizard, most source code is generated for you.
HWND hwndTree; int index; hwndTree = GetDlgItem(hwndDialog, IDC_TREE); // Get the tree window handle SftTree_SetShow3D(hwndTree, TRUE); // Use 3D display mode index = SftTree_AddString(hwndTree, "The First Item"); index = SftTree_AddString(hwndTree, "The Second Item"); SftTree_SetItemLevel(hwndTree, index, 1); index = SftTree_AddString(hwndTree, "The Third Item"); SftTree_SetItemLevel(hwndTree, index, 2); SftTree_RecalcHorizontalExtent(hwndTree); // For optimal horizontal scrolling
CSftTree m_Tree; int index; m_Tree.SubclassDlgItem(IDC_TREE, this); // Connect C++ object to window m_Tree.SetShow3D(TRUE); // Use 3D display mode index = m_Tree.AddString("The First Item"); index = m_Tree.AddString("The Second Item"); m_Tree.SetItemLevel(index, 1); index = m_Tree.AddString("The Third Item"); m_Tree.SetItemLevel(index, 2); m_Tree.RecalcHorizontalExtent(); // For optimal horizontal scrolling