# SftTree/OCX 8.0 — Full Documentation > SftTree/OCX is an ActiveX control for the Windows™ operating system, offering easy to use multi-line, multi-column, hierarchical data displays. SftTree/OCX can be used in any ActiveX (OLE) control container, including Visual Studio (.NET), Visual Basic 6, Visual C++ (MFC), Access and many more. Online documentation: https://softelvdm.com/Documentation/SftTree%20OCX%208%200 Complete API reference (separate file): https://softelvdm.com/Vault/Softelvdm.com/llms/SftTree-OCX-8.0-reference.txt ## SftTree/OCX 8.0 Product Documentation *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/1_main* SftTree/OCX is an ActiveX control for the Windows™ operating system, offering easy to use multi-line, multi-column, hierarchical data displays. SftTree/OCX can be used in any ActiveX (OLE) control container, including Visual Studio (.NET), Visual Basic 6, Visual C++ (MFC), Access and many more. ![Tree Components](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/components.gif) ### New in Version 8.0 SftTree/OCX 8.0 adds modern [accessibility](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_accessibility) and [high-DPI](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dpi) support, while remaining virtually 100% upward compatible with earlier versions: - [Dark Mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode), automatically following the Windows light/dark setting. - Windows [High Contrast](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast) accessibility support, honoring the user's contrast theme. - Accessibility (Screen Readers) - built-in UI Automation support for Narrator, NVDA, JAWS and other assistive technologies, plus an [Announce](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Announce) method for short status messages. - Per-Monitor DPI and Scaling - Per-Monitor v2 DPI awareness with automatic scaling of images and pixel dimensions. - A size box (resize grip) in the lower-right corner and a configurable minimum [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) offset. For the complete list, see [New Features](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_newfeatures). ### Tree Control SftTree/OCX offers many features from simple, graphical list box displays to complex hierarchical data displays: - Hierarchical item display - [Fixed or variable height items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_fixedvariableitems) - [Single and/or multiple text lines](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellMultiline) per [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) with [word wrap](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellWordWrap) - Single and [multiple selection](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_selections) built-in - [Virtual mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualmode) (for flat lists only) - [Content windows](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_contentwindows) for complete control over cell contents - Splitter bar - Printing and print preview support in conjunction with the separately available SftPrintPreview/OCX control. - [Tool Tips](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_tooltips) and [Scroll Tips](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_scrolltips) - [Drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop) with automatic scrolling - Built-in drag & drop or OLE drag & drop within and outside tree control - Single and multiple roots - [Expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons) - [Column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) as titles or buttons with graphics and text - [Column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters) as titles or buttons with graphics and text - [Resizable columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnresizing) - [Reorderable columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columndragdrop) - Individual column colors - Last column [open-ended](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_OpenEnded) or fixed-width - [Row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) as titles or buttons with graphics and text - Row/column header and row/column footer as titles or buttons with graphics and text - Selectable [column alignment](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellHAlign) (left, right, center) - [Sorting](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SortDependents) - Built-in [sort indicators](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_sortindicator) for column headers - [Cell editing](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellediting) using Windows controls - Cells with individual foreground and background colors, fonts and graphics - [Cell merging](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellmerging) - [Flyby highlighting](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_flybyhiglighting) - Tree items with individual attributes - All images fully customizable - [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus) image support (PNG, alpha-blended images) - Windows visual styles (themes) support - Dark mode support, automatically following the Windows light/dark setting - Windows High Contrast accessibility support - Per-Monitor v2 DPI awareness with automatic scaling of images and pixel dimensions - Built-in UI Automation provider for screen reader support (Narrator, NVDA, JAWS and others) - [Right-to-left reading support](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rtl) - Support for ActiveX (OLE) control containers such as Visual Studio (.NET), Visual Basic, Visual C++, Access, and many more - Item capacity only limited by available virtual memory ### Royalties Any application that you develop can use SftTree/OCX royalty-free in run-time only mode; design-time features are not available. Each user (developer) who needs access to design-time features must license a copy of SftTree/OCX. ### Source Code The source code for the control and [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) (written in Microsoft Visual C++ using the ATL framework) is optionally available under our Enterprise Licensing program. Any application that you develop can use SftTree/OCX royalty-free (some restrictions apply), as long as only the redistributable files are shipped with your application. ### Languages Supported SftTree/OCX supports all popular ActiveX (OCX) platforms, such as Visual Studio (.NET), Visual Basic, Visual C++, and many more. SftTree/OCX can be hosted in both .NET Framework and .NET 10 (or later) Windows Forms applications. Feature limitations may exist depending on the platform used. These are generally caused by the platform, rather than our control product, which implements the current ActiveX control standards specifications. Notably drag & drop and cell editing may be limited or unavailable in some control containers. ### Environments Supported SftTree/OCX supports Windows 10, Windows 11 and their server editions using the same set of properties, events and methods. UNICODE support is available for all platforms. ### AI / LLM Documentation The complete SftTree/OCX documentation is also published in an AI/LLM-readable format, following the [llms.txt convention](https://llmstxt.org). The index covering all Softel vdm products is at [https://softelvdm.com/llms.txt](https://softelvdm.com/llms.txt). The product installation includes an AGENTS.md file at the installation root, which points AI coding assistants at the product's online guide and API reference. The documentation is always read online, as it is updated between product releases. ## New Features *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_newfeatures* SftTree/OCX 8.0 is virtually 100% upward compatible from version 7.5 and older versions. Upgrading a project from an older version usually takes just a few minutes. For details about upgrading, please see "[Upgrading To Version 8.0](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_upgrading)". The following major enhancements have been made available with SftTree/OCX 8.0: - New built-in [UI Automation](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_accessibility) support exposes the tree structure, column and [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders), selection and expand/collapse state to Narrator, NVDA, JAWS and other screen readers. Split tree controls appear as a single, unified data grid to assistive technologies. - New [Announce](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Announce) method pushes short application-status text ("3 rows added", "Filter cleared", "Saved") to attached screen readers through a UI Automation notification event. - New [dark mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode) support with Automatic / On / Off settings, using the [DarkMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DarkMode) property. The Automatic setting tracks the Windows "Choose your mode" setting. The [DarkModeActive](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DarkModeActive) property reports the effective state, and the [DarkModeChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_DarkModeChange) event signals when it changes. - New [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast) accessibility support with Automatic / On / Off settings, using the [HighContrastMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_HighContrastMode) property. The [HighContrastActive](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_HighContrastActive) property reports the effective state, and the [HighContrastChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_HighContrastChange) event signals when it changes. - New [Per-Monitor DPI](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dpi) v2 awareness. Row height, grid lines, scroll-bar metrics, drag thresholds, 3D frames, the column [dropdown button](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dropdown), the resize handle and the control-owned expand/collapse glyphs scale automatically with the current monitor DPI. The [DPI](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DPI) property returns the effective DPI and the [DPIChanged](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_DPIChanged) event signals a DPI change. - New [ImageScaling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ImageScaling) property provides a one-step opt-in to automatic DPI scaling of every image the control draws - [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells), label, item, row-header, column-header and column-footer pictures, plus/minus bitmaps and user-supplied button bitmaps, as well as control-owned glyphs. - New [PixelScaling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_PixelScaling) property provides a one-step opt-in to treating caller-supplied pixel dimensions (column widths, indentation, row-header width, horizontal extent, item heights, splitter offset) as 96-DPI reference values, so serialized configurations remain portable across monitors of different DPI. - New [SizeBox](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_SizeBox) property controls whether a size box is shown in the tree control's lower-right corner, allowing the user to resize the control by dragging the corner grip. The companion [SizeBoxActive](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_SizeBoxActive) property reports whether the user is currently dragging the size box, so the host can suspend layout updates during interactive resizing. - New [Splitter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Splitter).[OffsetMin](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeSplitter_OffsetMin) and Splitter.[OffsetMinPix](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeSplitter_OffsetMinPix) properties set a minimum [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) offset for split tree controls, preventing the user from hiding the left pane. The following components have been removed: - SftTree/OCX 8.0 no longer supports Internet Explorer. The SftTreeIE control and cabinet (CAB) files have been removed. - SftTree/OCX 8.0 no longer supports Visual FoxPro. The SftTreeNC control has been removed. ## Upgrading To Version 8.0 *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_upgrading* ### Converting an Existing Application > The conversion is not automatic, but takes just a few minutes for a project. Only a minimal conversion is required when upgrading from SftTree/OCX 7.5 to SftTree/OCX 8.0. SftTree/OCX 8.0 is virtually 100% source compatible to older releases of SftTree/OCX. Your application(s) must be recompiled to use SftTree/OCX 8.0. **SftTree/OCX 8.0** and older versions of SftTree/OCX can coexist on the same system and can be used in the same application. > Make sure to back up your current projects, before converting your projects. Please read the conversion process specific to your language carefully *BEFORE* converting your project. After converting, once the control saves updated property settings, you will not be able to return to SftTree/OCX 7.5. Visual Basic .NET (Managed Languages) Visual C++ (Unmanaged C/C++) Delphi Other Development Tools #### Visual Basic After installing SftTree/OCX 8.0, all your projects will continue to use SftTree/OCX 7.5 until you make the following change in each project's main VBP (Visual Basic Project) file. Before opening the project file, make sure to close the project in Visual Basic, then edit the VBP file using a text editor and make the following changes: **Existing Project File (VPB File):** ``` Type=Exe Form=Form1.frm Reference=*\G{{00020430-0000-0000-C000-000000000046}}#2.0#0#G:\WINNT\System32\stdole2.tlb#OLE Automation Object={{9EBAA930-293D-44FA-9989-08F078763A1F}}#7.5#0; SftTree_IX86_U_75.ocx IconForm="Form1" Startup="Form1" ExeName32="yourexe.exe" Command32="" Name="yourproject" ``` The line describing **SftTree/OCX 7.5** (above, using a bold font) should be replaced with the following line: ``` Object={{04048830-2BE4-4868-8CDC-B8E6FC7815C5}}#8.0#0; SftTree_IX86_U_80.ocx ``` You can copy this line directly from this help file or copy it from the file "Upgrade.txt" which you can find in the SftTree/OCX product directory. The line must be copied as-is, without any modifications. **Existing Forms And Modules (FRM, BAS [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)):** All forms and modules must be edited using a text editor. The following changes can easily be accomplished by a global edit and replace operation: - [Edit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Edit) all occurrences of **SftTreeLib75** and replace them with **SftTreeLib80** Once the VBP and FRM file have been saved, you can open the project in Visual Basic. Make sure to review each form (in design mode) and save it to complete the upgrade. The controls will save updated property settings, so you will **not** be able to return to SftTree/OCX 7.5. Once all forms have been saved, the project is using SftTree/OCX 8.0. #### .NET (Managed Languages) While most other languages offer a fairly easy conversion, .NET and its languages require a bit more effort, but in most cases is limited to the steps documented below. **Existing Forms (FRM Files):** Updating the forms to use SftTree/OCX 8.0 is quite straightforward: - A reference to SftTree/OCX 8.0 needs to be added to the project. This is easily accomplished by adding a SftTree/OCX 8.0 control to any form of your project. It is located in the toolbox group *Softel vdm, Inc. *For information about this, please see "[Using SftTree/OCX with .NET](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet)". As soon as this new control is added to your form, the references are added to your project. The Solution Explorer window now shows two new references to AxSftTreeLib80 and SftTreeLib80. Once these references are added, the new control can be deleted from your form. The references remain. - If you are upgrading from a version prior to 7.5 also perform the following step: - Add the SftHelperComponent component to your form. It is located in the toolbox group *Softel vdm, Inc. *For information about this, please see "Using SftTree/OCX with .NET". The SftHelperComponent component is required for [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus)/.NET Image Object support using the [NETImageObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_NETImageObject) property. It also eliminates the need for the OLEConvert.cs or OLEConvert.vb source files that were used in earlier releases. - Close all forms. - Open each form, one at a time, using the *View Code *menu entry in the Solution Explorer window. The popup menu is accessed by right-clicking on a form name. If you accidentally open a form in design mode, close it without saving, as your current tree control settings for this form are most likely lost. - Edit all occurrences of **SftTreeLib75** and replace them with **SftTreeLib80** - If you are upgrading from a version prior to 7.5 also perform the following steps: - **C#:** Edit all occurrences of **using OLEConvert;** and replace them with **using Softelvdm.OLEConvert;** - **VB:** Edit all occurrences of **Imports* ****projectname***.OLEConvert** and replace them with **Imports Softelvdm.OLEConvert** - The existing references to SftTree/OCX 7.5 (or older) can now be removed. If the Solution Explorer window shows references to AxSftTreeLib75 and SftTreeLib75, these can be removed. - If your project includes the source file OLEConvert.cs (C#) or OLEConvert.vb (VB), remove it now. It is no longer needed. The forms can now be opened and the project uses SftTree/OCX 8.0 exclusively. You will **not** be able to return to SftTree/OCX 7.5. #### Visual C++ (Unmanaged C/C++) ##### Resource Files After installing SftTree/OCX 8.0, all your projects will continue to use SftTree/OCX 7.5 until you make the following change in each dialog resource that defines a SftTree/OCX control. Before opening the resource script (RC file), make sure to close the project in Visual C++, then edit the RC file using a text editor and make the following changes: ``` IDD_MFC_DIALOG DIALOGEX 0, 0, 320, 200 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW CAPTION "MFC" FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "OK",IDOK,260,7,50,14 PUSHBUTTON "Cancel",IDCANCEL,260,23,50,14 CONTROL "",IDC_TREECTRL1,"{9EBAA933-293D-44FA-9989-08F078763A1F}", WS_TABSTOP,1,2,242,196 END ``` The contents of the line describing SftTree/OCX 7.5 (above, using a bold font) should be replaced with the following: ``` CONTROL "",IDC_TREECTRL1,"{04048833-2BE4-4868-8CDC-B8E6FC7815C5}", ``` Only change the ClassID (i.e., {9EBAA933-293D-44FA-9989-08F078763A1F}), do not change the rest of the line. You can copy this information directly from this help file or copy it from the file "Upgrade.txt" which you can find in the SftTree/OCX product directory. The ClassID must be copied as-is, without any modifications. Once the RC file has been saved, you can open the project in Visual C++ and the project is now using SftTree/OCX 8.0. The controls will save updated property settings, so you will **not** be able to return to SftTree/OCX 7.5. Make sure to change ALL occurrences of SftTree/OCX to version 8.0, otherwise you will not be able to open the resource script (RC file). ##### #import Statements The #import statement used with SftTree/OCX 7.5 must be replaced with an #import statement for the new version: [Version](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Version) 7.5: ``` #pragma warning(disable : 4192) // automatically excluding 'Ixxx' while importing type library 'stdole2.tlb' // For information about the following construct, please see Microsoft's // KnowledgeBase entry Q224610 #import rename_namespace("SftTreeNameSpace") exclude("OLE_HANDLE", \ "OLE_COLOR", "IFontDisp", "IPictureDisp", "FONTSIZE") #import rename_namespace("SftTreeNameSpace") rename("LoadImage", "LoadImageSftTree") #if _MSC_VER >= 1400 // need at least Visual Studio 2005 # pragma comment(lib, "comsuppw.lib") // avoid link error in VS2005 #endif #pragma warning(default : 4192) using namespace SftTreeNameSpace; ``` New for SftTree/OCX 8.0: ``` #pragma warning(disable : 4192) // automatically excluding 'Ixxx' while importing type library 'stdole2.tlb' // For information about the following construct, please see Microsoft's // KnowledgeBase entry Q224610 #import rename_namespace("SftTreeNameSpace") exclude("OLE_HANDLE", \ "OLE_COLOR", "IFontDisp", "IPictureDisp", "FONTSIZE") #import rename_namespace("SftTreeNameSpace") rename("LoadImage", "LoadImageSftTree") \ exclude("LONG_PTR") #if _MSC_VER >= 1400 // need at least Visual Studio 2005 # pragma comment(lib, "comsuppw.lib") // avoid link error in VS2005 #endif #pragma warning(default : 4192) using namespace SftTreeNameSpace; ``` #### Other Development Tools Most development tools allow access to the ClassID used for controls on a form or dialog. Sometimes this may be accomplished by using a text editor and editing a configuration file, or possibly the development tool allows direct modification of the ClassID. Generally, the ClassID used for the prior release {9EBAA933-293D-44FA-9989-08F078763A1F} must be replaced with the new ClassID {04048833-2BE4-4868-8CDC-B8E6FC7815C5}. Once this step is completed, opening the project is sufficient to allow SftTree/OCX to convert the stored property settings. For specific instructions or help, please see your development tool's documentation. ## Installing SftTree/OCX *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_installation* ### System Requirements SftTree/OCX 8.0 has the following system requirements: - The control supports 32-bit and 64-bit applications under Windows 10, Windows 11 and their server editions. - There are no minimum system requirements to use the control. - A 32-bit or 64-bit Windows development environment and a compiler/language, which supports ActiveX controls. - Approximately 100MB of hard disk space is required to install SftTree/OCX. ### Installing SftTree/OCX When you are ready to install SftTree/OCX: 1. Run the setup application - The download location is provided either with your license information at the time of purchase or you can download the product [demo](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_demo_application) from our web site. Both the product and demo setup applications are identical and can be used interchangeably. ![Installation](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/installation.png) 2. Follow the instructions on the installation dialogs. Please note that the single developer version of SftTree/OCX can only be installed by one user on one system. Multiple developer licenses and site licenses are available. Contact [Softel vdm, Inc.](https://softelvdm.com/About) for more information. 3. During the installation, you will be prompted to register the product using the [License](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_License) Manager application. Without proper registration, the product will not run. Once you are a registered user, you can take advantage of our [product support](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_contactsoftel), such as free maintenance versions, and you will receive information regarding new releases. 4. Once SftTree/OCX has been successfully installed, you will find a new program group *SftTree/OCX 8.0*. Entries for the SftTree/OCX Demo, sample applications, the on-line help file and the release notice have been added. ## Tree Components *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents* The following describes the individual components that are available in a SftTree/OCX tree control. All components, except for the first column displaying an item's text, are optional. By turning all optional components off, the SftTree/OCX tree control can visually act as a simple list box. ## Split Tree Control - Splitter Bar *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar* A split tree control is a tree control that has multiple columns and a splitter bar (see the [Splitter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Splitter).[Visible](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeSplitter_Visible) property). The splitter bar is used to separate columns so the columns can be scrolled individually. Both the left and right panes can be scrolled horizontally. This is most useful to lock the first column while being able to scroll the remaining columns horizontally. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/splitter1.gif) The number of columns displayed in the left pane is defined using the Splitter.[Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeSplitter_Column) property. The width of the splitter bar can be defined using the Splitter.[Width](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeSplitter_Width) property. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Right-To-Left Reading Support *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rtl* When the [RightToLeft](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_RightToLeft) property is set to True, the tree control will support right-to-left reading where the tree hierarchy is displayed on the right hand side of the control. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) are displayed from right to left, so column 0 is shown on the right side, with column 1 to its left, and so forth. The vertical scroll bar is positioned along the left edge of the control. > Right-to-left reading support is only supported by certain international Windows versions, such as Hebrew and Arabic Windows. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/rtl1.gif) All tree control attributes, properties and methods are fully supported when right-to-left reading support is used. In this documentation, the terms "left" and "right" should be reversed when right-to-left reading support is used. In a [split tree control](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) when right-to-left reading support is used, the tree control pane containing the hierarchy is displayed on the right side. Normally, the hierarchy is shown in the left pane. Using right-to-left reading support is transparent to the application, but [column alignment](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellHAlign) should be adjusted by the application. ## Using Themes *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_themes* Windows themes can be selected by the user using the Windows settings. If a theme is selected, the display of user interface controls, such as SftTree/OCX, adapts to the current display theme. Themes can provide various display styles for the same control. With themes active, Windows renders (paints) the control: | | | | --- | --- | | ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/theme1.gif) | ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/theme2.gif) | | Without Themes | With Themes | By using the [UseThemes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_UseThemes) property, SftTree/OCX adapts to the current theme used. If set to False, themes are not honored and the control is rendered using the built-in style. SftTree/OCX makes it easy to use the same application across all supported platforms. If Windows themes are not available, the control will simply use its built-in display style, otherwise it will fully exploit Windows themes. To prepare an application for proper themes support, the control should be designed and tested on a supported Windows platform. It should be viewed both with and without themes to make sure that the defined control is visually satisfactory in both cases. Controls designed for use on a Windows version with themes will work identically on all other platforms, even when themes support is not available. > Keep in mind that numerous control definitions, particularly relating to colors, have no effect when themes are active. You can find out if a specific control setting has any effect with themes active by consulting the detail information in this documentation. Windows themes work together with the control's [Dark Mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode) and [High Contrast](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast) support. When dark mode or Windows High Contrast is active, the control adapts its rendering accordingly and Windows themes are suppressed. ## Dark Mode *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode* SftTree/OCX 8.0 supports dark mode. By default the tree control uses the light palette. An application opts in by setting the [DarkMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DarkMode) property to [darkSftTreeAuto](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeDarkModeConstants) so the control follows the Windows "Choose your mode" setting automatically - users who have selected Dark see a dark color palette and users who have selected Light see the traditional palette, and the control re-renders when the user flips between them. darkSftTreeOn always uses the dark palette regardless of the Windows setting. What changes in dark mode: the tree background, item text, grid lines, selection highlight, [column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders), [column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters), [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders), the row/column-header corner, the row/column-footer corner and the [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) (in a split tree control) all switch to dark-palette colors. [Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) edit controls and tooltips inherit the dark palette automatically. The DarkMode property has three values (see SftTreeDarkModeConstants): | Value | Description | | --- | --- | | darkSftTreeAuto | Follow the Windows "Choose your mode" setting. The control re-renders when the system setting flips. | | darkSftTreeOn | Always use the dark palette, regardless of the Windows setting. Useful when the hosting application has its own Light / Dark toggle and wants the tree to follow it. | | darkSftTreeOff (default) | Always use the light palette, regardless of the Windows setting. Useful when the application does not yet support dark mode end-to-end and mixing dark and light controls would look wrong. | The [DarkModeChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_DarkModeChange) event is fired each time the active dark mode state flips (darkSftTreeAuto only) so the application can repaint its own chrome around the tree control. The [DarkModeActive](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DarkModeActive) property reports the current state at any time. Caller-supplied color overrides (per-column colors, permanent background, odd-row colors, selection colors, grid colors) are still honored in dark mode - the control does *not* override application-chosen colors. If you need specific cells to stand out in dark mode, pick accent colors that read well on both a light and a dark background (mid-tone saturated values in the RGB 30-210 range tend to work in both). [Windows themes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_themes) are suppressed while dark mode is active. [Header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Header), footer and other chrome elements fall back to the tree's built-in dark-aware rendering path so they match the control's dark palette instead of the system's light-themed header style. Dark mode and [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast) are independent settings. If the user has both enabled, high contrast takes precedence. See High Contrast. ## High Contrast *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast* Windows High Contrast is an [accessibility](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_accessibility) setting, not a visual preference. Users who enable it have committed to a specific high-contrast color scheme for everything on screen, and Microsoft's accessibility guidelines require applications to let the user's scheme win over any application-chosen colors. SftTree/OCX 8.0 follows this rule automatically. When Windows High Contrast is active, the tree control renders backgrounds, text, selection, grid lines and other elements using the system high-contrast colors, ignores caller-supplied color overrides (per-column colors, permanent background, odd-row colors) so the user's contrast theme wins, and suppresses [Windows themes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_themes) so [column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders), [column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters) and [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) honor the system colors directly. The [HighContrastMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_HighContrastMode) property has three values (see [SftTreeHighContrastConstants](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeHighContrastConstants)): | Value | Description | | --- | --- | | highContrastSftTreeAuto | Follow the Windows High Contrast setting. The control re-renders when the setting flips. | | highContrastSftTreeOn | Always use the system palette, regardless of the Windows High Contrast setting. Useful for testing or for applications that want consistent high-contrast rendering for a specific tree. | | highContrastSftTreeOff (default) | Ignore the Windows High Contrast setting and render normally. Not recommended in shipping applications - it means users with accessibility needs will see rendering that does not comply with their contrast theme. | The [HighContrastChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_HighContrastChange) event is fired each time the active state flips (highContrastSftTreeAuto only) so the application can repaint its own chrome to match. The [HighContrastActive](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_HighContrastActive) property reports the current state at any time. [Dark mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode) and Windows High Contrast are independent. If the user has both enabled, high contrast takes precedence - the contrast theme's palette wins over the dark palette, because honoring the user's contrast theme is the stronger accessibility requirement. See Dark Mode. ## Accessibility (Screen Readers) *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_accessibility* SftTree/OCX 8.0 includes built-in Windows UI Automation (UIA) support. Users who rely on Narrator, NVDA, JAWS or any other UIA-compatible assistive technology can read and navigate the control without the hosting application doing any work. There is no opt-in and no code change required. What the screen reader sees: | Element | Exposed as | | --- | --- | | Control type | **Data grid**. Row / column / [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) navigation is available through standard grid shortcuts. A [split tree control](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) exposes a *single* unified data grid (not two nested grids) so the user experiences the same structure regardless of split. | | Rows | Each item is a row fragment that carries its tree level, expand / collapse state and selection state. The parent / child / sibling hierarchy of the tree is preserved in UIA navigation. | | [Column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) / [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) / footers | Exposed as separate header fragments with the header text spoken as the name. Sort indicators are reflected in the header name. | | Cells | Each cell is addressable individually. Cells using check-box or radio-button images advertise the matching control type and toggle / selection state, so the screen reader announces "checked" / "unchecked" / "mixed" as appropriate. | Event notifications are raised automatically: selection changed, caret changed, vertical / horizontal scroll, expand / collapse, column resize, insert / delete item and cell toggle-state changed. The provider loads on demand the first time a UIA client queries the control, so there is no overhead for applications whose users never attach an assistive technology. Two things the application controls: - Provide descriptive tooltip text through the control's [ToolTip](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_ToolTip) events (for example [ToolTipColumnHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipColumnHeader) and [ToolTipCell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipCell)) so headers and cells convey useful information. - Call the [Announce](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Announce) method to push short application-status text ("3 rows added", "Filter cleared", "Saved") to attached screen readers. Announce is the right tool for momentary status updates that do not have a visible representation in the tree. [Dark mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_darkmode) and [Windows High Contrast](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_highcontrast) are independent accessibility settings. SftTree/OCX honors both automatically. See Dark Mode and High Contrast. ## Per-Monitor DPI and Scaling *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dpi* SftTree/OCX 8.0 is fully Per-Monitor v2 DPI-aware. A tree control hosted on a Per-Monitor v2 aware top-level window re-renders automatically when its window moves to a monitor of a different DPI or when the system DPI changes. The control owns the metrics it controls; the caller owns the images and fonts it provides. Two opt-in properties let the caller hand those over to the control as well. ### Host setup The host application must declare Per-Monitor v2 DPI awareness. This is the single most common reason high-DPI applications do not re-render correctly when moved between monitors of different DPI. Without a Per-Monitor v2 declaration, Windows keeps the process in System-aware mode: the DPI is fixed for the process lifetime, the control does not observe DPI changes, the [DPIChanged](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_DPIChanged) event is never fired, and high-DPI monitors render at System-DPI sizes stretched by Windows. Declare Per-Monitor v2 awareness in the host application's manifest, for example: ``` PerMonitorV2 True/PM ``` In a .NET project, this corresponds to selecting *Per Monitor V2* for the application's DPI awareness. The [DPI](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DPI) property returns the control's current monitor DPI (96 at 100%, 120 at 125%, 144 at 150%, 192 at 200%). If the returned value never changes as the window is dragged between monitors with different scale factors, the host is not in Per-Monitor v2 mode. ### What scales automatically When the host is Per-Monitor v2 aware, the control scales these metrics itself on every DPI change without any caller involvement: row height and item height, grid-line thickness, scroll bar and scroll arrow metrics, the drag threshold, 3D frame widths, the column drop-down / filter button width, and the [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) width. (The control-drawn expand / collapse glyphs and the split-tree resize handle are images rather than metrics; they follow the [ImageScaling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ImageScaling) setting described below, not this automatic metric scaling.) ### What the caller controls Two independent opt-in properties let the caller choose whether caller-supplied images and pixel metrics also scale with DPI. Both default to back-compatible behavior (no automatic scaling), so existing applications keep working unchanged. Each uses [SftTreeScalingConstants](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeScalingConstants): scalingSftTreeAsIs (default) or scalingSftTreeStretch. | Property | Covers | scalingSftTreeAsIs (default) | scalingSftTreeStretch | | --- | --- | --- | --- | | ImageScaling | Every image the control draws: [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells), label, item, row-header, column-header and column-footer pictures; plus / minus bitmaps; user-supplied tree button bitmaps; and control-owned glyphs (the expand / collapse button glyphs, the split-tree resize handle and checkmarks). | Images are drawn at their native pixel size. Bitmaps supplied at 96 DPI look physically smaller on a high-DPI monitor. | Images are scaled by *current DPI / 96* using high-quality interpolation. | | [PixelScaling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_PixelScaling) | Caller-supplied pixel dimensions: column widths, indentation, [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) width, horizontal extent and offset, item heights and the splitter offset. | Values are used verbatim in physical screen pixels. A column width of 100 is 100 pixels on any monitor. | Values are interpreted as 96-DPI reference pixels (100 pixels at 100%, 150 at 150%, 200 at 200%). Stored values and getters always return caller-reference units, so serialized configurations stay portable across monitors of different DPI. | ### On DPI change When the control's monitor DPI changes, the DPIChanged event is fired. The application should re-send a font sized for the new DPI (the control does not own the application's font). If ImageScaling is scalingSftTreeStretch and PixelScaling is scalingSftTreeStretch, no further action is needed - the control scales existing images and stored pixel values automatically. ## Drag & Drop *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop* SftTree/OCX supports three different types of drag & drop, based on the [DragMethod](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DragMethod) settings. ### OLE Drag & Drop If the DragMethod property is set to [dragSftTreeOLE](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeDragMethodConstants), OLE drag & drop mechanisms are used. This is the most powerful drag & drop method supported by SftTree/OCX. In this mode, drag & drop between controls in the same application and between different applications is supported, including drag & drop to and from Windows Explorer. Using the [OLEDropMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_OLEDropMode) property, SftTree/OCX can be defined as a valid [drop target](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_DropHighlight). The [OLEDragDrop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_OLEDragDrop) event occurs when a drop occurs on the tree control. The [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).DropHighlight property describes the item where the drop occurred. The application can retrieve the data and data format using the [DataObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_DataObject).[GetData](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_GetData) and DataObject.[GetFormat](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_GetFormat) methods. SftTree/OCX can also be used as the source of a drag & drop operation. By using the DragMethod property (set to dragSftTreeOLE), the [OLEStartDrag](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_OLEStartDrag) event occurs as soon as a drag & drop operation is about to begin. The [DragType](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_DragType) property defines how a drag & drop operation can be started by the user. The DragMode property must be set to vbManual for OLE drag & drop. In the OLEStartDrag event, the application can define the data or data formats and drop effects that are supported for the drag & drop operation. ### Drag & Drop Controlled by SftTree/OCX If the DragMethod property is set to dragSftTreeAuto, SftTree/OCX handles all drag & drop operations within one tree control. This mode is not suitable for drag & drop between different tree controls or applications in general. It is intended for environments where the container application (e.g. Visual Basic, Visual C++, etc.) does not support drag & drop between controls. SftTree/OCX generates the events [AutoDragging](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_AutoDragging), [AutoEndDragging](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_AutoEndDragging) and [AutoCancelDragging](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_AutoCancelDragging) to notify the application about the progress of the drag & drop operation. ### Drag & Drop Controlled by the Container Application If the DragMethod property is set to dragSftTreeManual, SftTree/OCX does not handle the drag & drop operations. SftTree/OCX supports a drag & drop protocol by generating a [DragStarting](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_DragStarting) event when the user initiates a drag & drop operation. The DragStarting event is only used to signal that the user has requested a drag & drop operation. The actual implementation of the drag & drop operation is delegated to the container, which must support drag & drop between controls. Some host environments may not implement the required events and properties to drag to another tree control or control type. Some environments may not even support drag & drop operations at all. Please see the documentation that came with your development environment for more information. Environments that support the necessary methods and events can make use of the drag & drop support built into SftTree/OCX. The Items.[HitTest](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_HitTest) and Items.DropHighlight properties can be used to visually update the tree control during a drag & drop operation. When dragging within the tree control, the drop target can be updated using the Items.DropHighlight property, which causes automatic scrolling vertically when the mouse cursor moves to the first or last [visible item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_visibilitystatus). ## Horizontal Scrolling *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_horizontalscrolling* Using horizontal scrolling is very easy, even if multiple columns are used. The [Scrollbars](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Scrollbars) property is used to define the desired scroll bars. Once all items have been added to the tree control, the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[RecalcHorizontalExtent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_RecalcHorizontalExtent) method must be used to allow the control to determine the optimal horizontal scrolling extent, which is determined by column widths and the text in the last column. The [OffsetChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_OffsetChange) event occurs when the tree control is scrolled horizontally by the user. > Even if horizontal scroll bars are defined, Items.RecalcHorizontalExtent must be used after all items have been added, otherwise the horizontal scroll bar will not be enabled or updated. ## Items *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_items* [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items) within tree controls have relationships to other items based on the level they are on. This determines how items are connected to each other. The following table defines the terms used throughout to identify relationships and the connecting lines drawn for each type: ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/treeitems1.gif) The following table defines the terms used throughout to identify relationships and the connecting lines drawn for each type: | Term | Description | | --- | --- | | [Dependents](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dependents) | A dependent is an item which has a parent. The item is said to be a dependent of the parent item. Dependents can be parent items themselves or leaf items. A dependent cannot be at the [root level](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_rootlevel). The [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[FirstDependent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_FirstDependent) and Item.[LastDependent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_LastDependent) properties can be used to retrieve dependent item information for an item. | | [Expand Status](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_expandstatus) | The expand status indicates whether dependent items are visible or not. A parent item that has one or more visible dependents is considered [expanded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapseitems). If a parent item is expanded, all its immediate dependents, i.e., all dependents on the next lower level are visible. If a parent item is collapsed, no immediate dependents are visible. The Item.[Expanded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expanded) property can be used to determine the current expand status of an item. Items can be expanded and collapsed using the Item.[Expand](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expand) and Item.[Collapse](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Collapse) methods. An item can be marked expandable using the Item.[Expandable](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expandable) property, even if it has no child items. | | [Leaf Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_leafitem) | A leaf item is an item which has no dependents, i.e., it is not a parent item. Leaf items may have sibling and parent items. | | [Parent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Parent) | A parent item can be located at any level. In order to become a parent item, an item has to have one or more dependents, which are items that immediately follow the parent item and are on a lower level. A parent item may be expanded and collapsed using the Item.Expand and Item.Collapse methods. Expanding a parent item means making its immediate dependents (dependents on the next lower level) visible. Collapsing a parent item means hiding all its dependents (on all lower levels). Parent items may have sibling and parent items. An item can be marked expandable using the Item.Expandable property, even if it has no child items. The Item.Parent property returns an item's parent index. | | Root [Level](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Level) | Any item without parent is at the root level, usually level 0. Multiple items can be at the root level, parent items or leaf items. The Item.Level property can be used to retrieve an item's level number. | | [Siblings](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_siblings) | A sibling is an item which precedes or follows another item on the same level with the same parent. An item can have zero or more sibling items. Sibling items can be parent and leaf items. The Item.[FirstSibling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_FirstSibling), Item.[NextSibling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_NextSibling), Item.[PrevSibling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_PrevSibling), Item.[LastSibling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_LastSibling) properties can be used to retrieve sibling information about an item. | | [Top Parent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_topparent) | A parent item is a top parent (or top level parent) if it has no parent of its own. Top parent items may have sibling items. The Item.[TopParent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_TopParent) property can be used to retrieve the topmost parent item. | | [Visibility Status](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_visibilitystatus) | The visibility status indicates whether an item is visible or not. An item is considered visible if its immediate and all other parent items are expanded. An item is considered visible even if it isn't currently displayed in the window client area. The Item.[Shown](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Shown) property can be used to define an item's visibility status. | When adding items to a tree control, all that is required from an application is that the level numbers be set. The SftTree/OCX tree control automatically determines the correct relationships and draws connecting lines appropriately. Applications can then interrogate the tree control about relationships and don't have to manage these themselves. ## Row Headers *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders* The optional row headers are available for single- and multi-column trees, with labeled buttons or just titles (see [RowHeaders](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_RowHeaders).[Appearance](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeaders_Appearance)). The header or button labels may be left or right adjusted or centered within the available width (see RowHeaders.[TextHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_TextHAlign) and RowHeaders.[TextVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_TextVAlign), [RowHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_RowHeader).[TextHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_TextHAlign) and RowHeader.[TextVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_TextVAlign)). Row headers can contain graphics (see RowHeader.[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_Image) and RowHeader.[ImageHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_ImageHAlign) and RowHeader.[ImageVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_ImageVAlign)). Row header text is defined using the RowHeader.[Text](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_Text) property. The built-in row headers offered by SftTree/OCX support one or multiple lines of text for each item and one graphic for each item (see RowHeaders.[Lines](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_Lines)). In a [fixed height](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_fixedvariableitems) tree control all graphics must be the same height and width for all items. In a variable height tree control, the row header graphics can be of varying height and width. If a user clicks on a row header, the application receives an [ItemClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemClick) or [ItemDblClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemDblClick) event. Row header buttons reflect the currently [selected items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_selections) (see [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[Selection](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Selection) and RowHeaders.[RemainUp](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_RemainUp)). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Expanding/Collapsing Items *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapseitems* SftTree/OCX supports expanding and collapsing tree items with minimal application intervention. [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items) in a tree control are managed as a linear list, or array, of items. The application can expand and collapse items without having to add or remove items. The tree control takes care of hiding and making items visible as needed. The [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons) are automatically displayed as needed for parent items with [dependent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dependents) items. The [AutoRespond](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_AutoRespond) property allows the tree control to expand and collapse items automatically or under program control. Under program control, an application can respond to [ItemClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemClick) and [ItemDblClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemDblClick) events and expand or collapse items using the [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[Expanded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expanded) property or the Item.[Expand](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expand) and Item.[Collapse](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Collapse) methods. An application can also fully control expanding and collapsing tree items. Rather than adding all items, including dependent items (child items), an application can add all parent items and mark them as expandable without actually adding the dependent items (see the Item.[Expandable](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Expandable) property). Then, once the application receives an ItemClick event, signaling that the user wants to expand a parent item, the application can add the dependent items. When items are expanded or collapsed, the [ItemExpanded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemExpanded) or [ItemCollapsed](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemCollapsed) events occur. ## Expand/Collapse Buttons *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons* Expand/collapse buttons are optional buttons displayed on the tree lines (see [ButtonStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ButtonStyle) and [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[TreeLineStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_TreeLineStyle)) to allow users to expand and collapse tree sections by clicking a button. The button graphics can be modified using the [ButtonAppearance](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ButtonAppearance) property and are shared between all items. Items on level 0 (the highest level or [root level](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_rootlevel)) have special level 0 expand/collapse buttons which can be enabled separately, but share the same graphics. Expand/collapse buttons for individual items can be suppressed using the [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[HideExpandCollapseButton](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_HideExpandCollapseButton) property. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Fixed / Variable Height Items *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_fixedvariableitems* There are two methods by which a tree control determines the height of an item. Based on the property [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[Style](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Style), a variable height or fixed height tree control is created. ### Fixed Height Tree Control In a fixed height tree control, each item has the same height. SftTree/OCX determines the best item height for all items by analyzing the default font height ([Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Font) property), the number of text lines (Items.[Lines](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Lines)), the [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) graphic height ([Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Cell).[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Image)), 3D display mode (Items.[Cell3D](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Cell3D)), label graphic height ([Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[LabelImage](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_LabelImage)), the plus/minus graphic height (Items.[PlusMinusImageExpandable](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_PlusMinusImageExpandable)), the [expand/collapse button](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons) graphic height ([ButtonAppearance](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ButtonAppearance)), the tree line style (Items.[TreeLineStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_TreeLineStyle)), the item graphic height (Item.[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Image)), grid line style (Items.[GridStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_GridStyle)), the [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) font ([RowHeaders](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_RowHeaders).[Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_Font)), the row header picture height ([RowHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_RowHeader).[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeader_Image)) and the number of text lines (RowHeaders.[Lines](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeRowHeaders_Lines)). If a component is not used, it is not considered to determine the best height. Cell fonts (Cell.[Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Font)) are not considered. If a cell font is used in a fixed height tree control, the application must insure that the cell font is not larger than the default font. All row header graphics must be the same height and width (RowHeader.Image). All label graphics must be the same height and width (Item.LabelImage). All item graphics must be the same height and width (Item.Image). All cell graphics in all columns must be the same height and width (Cell.Image). An application can override the item height using the Items.[MinHeightPix](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_MinHeightPix) and Items.[MaxHeightPix](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_MaxHeightPix) properties. ### Variable Height Tree Control In a variable height tree control, items have varying heights. Each item's height is individually recalculated as attributes change. This places an additional performance constraint on the tree control, so a variable height tree control should only be used when variable height items are necessary. SftTree/OCX determines the best item height for each item by analyzing the default font height (Font property), the cell font (Cell.Font) and cell graphic height (Cell.Image) for each column, the number of text lines (Items.Lines) and [word wrap](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellWordWrap) style for each cell ([Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[CellMultiline](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellMultiline) and Column.CellWordWrap), 3D display mode (Items.[Cell3D](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Cell3D)), the item's label graphic height (Item.LabelImage), the plus/minus graphic height (Items.PlusMinusImageExpandable), the expand/collapse button graphic height (ButtonAppearance), the tree line style (Items.TreeLineStyle), the item's item graphic height (Item.Image), grid line style (Items.GridStyle), the row header font (RowHeaders.Font), the item's row header picture height (RowHeader.Image) and the maximum number of text lines (RowHeaders.Lines). If a component is not used, it is not considered to determine the best height. An application can override the item height using the Item.[MinHeightPix](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_MinHeightPix) and Item.[MaxHeightPix](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_MaxHeightPix) properties. ## Item IDs *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_itemids* [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items) in a tree control are managed as a linear list or array of items. All methods and properties that access a particular item require the item index. This is a zero-based number describing the item position. The first item in the tree control has item index 0, the second is item 1, etc. Consequently, if an item is inserted at the top of the list, all previously added items now receive a new item index. | | | | --- | --- | | *Index 0* | First Item | | *Index 1* | Second Item | | *Index 2* | Third Item | | *Index 3* | Fourth Item | Once a new item is added, the tree control looks like this: | | | | --- | --- | | *Index 0* | New Item | | *Index 1* | First Item | | *Index 2* | Second Item | | *Index 3* | Third Item | | *Index 4* | Fourth Item | An item index describes the position in the tree control, so it is subject to change if items are added or removed. In some cases it may be easier to work with a constant value describing an item no matter where it is located in the list of items. This is possible using item IDs. Once an item has been added to the tree control, its [ID](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_ID) can be retrieved using the [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).ID property. The returned item ID does not change, even if other items are added or removed. Given an item ID, the current item index can be found using the Items.[ItemIndex](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ItemIndex) property. Saving the item ID is most useful for top level parent items. Top level items usually show item categories. Since adding or removing child items of other parent items changes a top level parent's index, it is easier to work with item IDs. When a top level parent item is added, save the item ID retrieved using the Item.ID property. Later, regardless of how many other items have been added or removed, using Items.ItemIndex with the saved item ID will return the current item index. ## Selections *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_selections* A SftTree/OCX tree control supports single and multiple selection based on the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[MultiSelect](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_MultiSelect) property settings. The Items.[SelectStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectStyle) and Items.[OutlineStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_OutlineStyle) properties determine the visual appearance of the selection. > The area where a selection change occurs can be defined using the Items.[SelectionArea](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectionArea) property. The user can change the selection in a tree control by using the arrow keys, PgUp, PgDn, Home, End, etc. As the selection changes, an application receives a [SelectionChange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_SelectionChange) event. ### Single Selection In single selection mode, only one item can be selected (highlighted) at a time. When a new item is selected, the previously selected item is then no longer selected. The current position (or caret location) is automatically selected, except while a [drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop) operation is in progress. The caret location indicates the [drop target](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_DropHighlight) and the selected item is the source. Drag & drop can cause the caret location to be a deselected item. This behavior can be affected by the Items.[DropHighlightStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_DropHighlightStyle) property. The Items.[Selection](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Selection) property returns the index of the selected item. The [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[Selected](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Selected) property returns an item's selection status. Items can be selected using the mouse, by clicking anywhere on the item to be selected, from [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) (leftmost position) to the right side of the window area. Moving the caret location using the arrow keys also automatically selects the item at the new caret location. Depending on the Items.SelectionArea setting used, items can be selected using the mouse by clicking anywhere on the item to be selected, from row header (leftmost position), label graphic to the right side of the window area. Moving the caret location, using the arrow keys, also automatically selects the item at the caret location. ### Multiple Selection In multiple selection mode, many items can be selected (highlighted) at the same time. The current position (or caret location) is automatically moved to the new location when clicking anywhere on an item. Items can be selected using the mouse by clicking anywhere on the area defined by the Items.SelectionArea property or by using the arrow keys. The new selection replaces the previous selection. If the CONTROL key is used, the selection is added to previous selections. If the SHIFT key is used, the entire range of items is selected, from the first selected item to the newly selected item. If the SHIFT and the CONTROL keys are pressed, a range of items is added to the previous selection(s). The Items.[SelectionCount](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectionCount) property returns the number of selected items. The Items.Selection property returns the index of selected items. The Items.[SelectionGroupStart](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectionGroupStart) and Items.[SelectionGroupEnd](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectionGroupEnd) methods are used to retrieve groups of selected items. The Item.Selected property returns an item's selection status. The Items.[SelectRange](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectRange) method can be used to select or deselect a range of items. Depending on the Items.SelectionArea settings, the CONTROL key (in combination with directional keys) can be used to move the caret location without moving the current selection. The Items.[RubberbandSelection](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_RubberbandSelection) property can be used to enable click-drag selection of multiple items using a selection rectangle. ## Flyby Highlighting *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_flybyhiglighting* As the mouse cursor is positioned above any [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) of an item in the tree control, the cell text in the first displayed column can be shown underlined or rendered using a [selection outline](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_OutlineStyle) (depending on the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).OutlineStyle property). This helps users easily identify above which item the mouse cursor is located in a multi-column tree control. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/flyby1.gif) Flyby highlighting can be enabled using the Items.[FlybyHighlightStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_FlybyHighlightStyle) property. Whenever the item highlighted by flyby highlighting changes, the [FlybyHighlight](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_FlybyHighlight) event occurs. ## Cells *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells* Each item in a tree control consists of one or multiple cells, one for each defined column. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/mergedcell1.gif) Cells support a single or multiple lines of text, cell contents can be [merged](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellmerging), cells can be edited and they can even contain other windows. ## Cell Merging *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellmerging* The contents of a [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) can merge into an adjacent cell (on the right), including the cell colors, fonts and graphics attributes. If a cell is empty, i.e. has no cell text or graphic, the cell immediately to the left may merge into the empty cell, using the additional space to display its contents. The column containing the cell has to be defined using the Column.[Merge](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_Merge) property, defining that the cell may merge into the next column's empty cell. The next column has to be defined using the Column.[MergeInto](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_MergeInto) property, indicating that it can be "merged into". The cell in the next column must be empty, i.e. it has no cell text or cell graphic. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/mergedcell1.gif) [Column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) and [column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters) also use the settings found in the [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).Merge and Column.MergeInto properties. If a column header or column footer is empty and the previous column has been adequately defined using the Column.Merge property, the column headers or column footers merge. If the columns are resizable, a small resizing handle is shown in the combined column header or column footer. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/mergedcell2.gif) ## Multi-Line Cell Text *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_multilinecelltext* [Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) text can consist of several text lines. The number of text lines can be defined using the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[Lines](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Lines) property. In a [fixed height](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_fixedvariableitems) tree control, the specified number of lines are reserved for each cell text. The text is aligned based on the [Item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Item).[Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_Cell).[TextHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_TextHAlign) and Item.Cell.[TextVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_TextVAlign) property settings. In a variable height tree control, up to the specified number of lines are displayed. If fewer text lines are available, the item height is adjusted if possible, based on other item attributes. If more text lines are available than fit in the cell, the symbol "+" is shown in the bottom right of the cell. Cell text can word-wrap and can contain explicit line breaks (new-line characters CR-LF). Word-wrap is defined using the [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[CellMultiline](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellMultiline) and Column.[CellWordWrap](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellWordWrap) properties. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Cell Editing *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellediting* Starting with release 5.0 of SftTree/OCX, a new cell editing mechanism is available. This new mechanism allows many more controls to be used for cell editing. Up until this release, only a built-in edit control and combo box were available for cell editing. While the old mechanism is still available, it is recommended to only use the new cell editing method, as it offers much more flexibility and control over the editing process. ### Overview SftTree/OCX supports many Windows controls and ActiveX controls can be used for cell editing. Each language or development environment offers its own edit controls, combo boxes, etc.which can normally be used with SftTree/OCX. Even ActiveX controls, such as SftMask/OCX Masked [Edit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Edit) Control and SftBox/OCX Combo Box can be used, significantly improving upon the standard Windows controls. SftTree/OCX offers a simple approach to cell editing. The application retains control and ownership of all controls used for cell editing. All their properties can usually be defined at design-time, even using their [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) if available. In order to use a control for cell editing, it is simply added to the form that also contains the tree control. Because only one [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) can be edited at a time, only one control is needed for the entire tree control. Of course, it is also possible to use several different kinds of controls, an edit control for some cells and a combo box control for others. One of each control type is added to the form. When cell editing is started using the [Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Cell).Edit method, a number of events occur that are used to position the control used for cell editing, initialize its contents and prepare it for editing. First, the [EditInitializing](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditInitializing) event occurs. It is used to make a control for cell editing available, by returning a control window handle. The control's display attributes and contents are initialized by this event and the desired size calculated. Its dimensions and position should be returned in the event's *Left*, *Top*, *Width*, *Height *arguments. This allows the control's position to be determined by the application. The control used for cell editing does not necessarily have to have the same dimensions as the cell being edited. It can also be larger or smaller. Then the [EditInitialized](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditInitialized) event occurs. Cell editing is about to begin. The control's position and dimension can be set, based on the *Left*, *Top*, *Width, Height* arguments. The application also must make the control visible, enabled and set the input focus to the control and additional final customizations can be performed. For example, when a combo box is used, this event can drop down the dropdown portion of the edit control. Once cell editing is in progress, the user can end cell editing by hitting the ESCAPE key or by clicking outside the cell being edited. Whenever cell editing ends, data entered must be validated (unless the user is abandoning the input data, for example by hitting the ESCAPE key). The [EditValidate](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditValidate) event occurs when the new contents of the cell being edited are to be validated. An application can test the new input data, display an error message if necessary and cell editing can resume. The [EditEnding](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditEnding) event occurs after input validation has occurred (EditValidate event) and the input data is valid. This event is used to save input data in the tree control and to hide and disable the control used for cell editing. Once cell editing has completely ended, the [EditEnded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditEnded) event occurs. If the user is editing a cell and uses cell navigation to edit another cell or clicks on another cell for editing purposes, the EditEnded event does not occur after the EditEnding event. Instead, the entire cell editing process is restarted with the initial EditInitializing event. ### Cell Editing & Navigation Even though many different Windows and ActiveX controls can be used for cell editing, SftTree/OCX offers complete navigation features while cell editing is in progress. Keystrokes, such as the TAB key, RETURN key, arrow keys, etc., can be intercepted and interpreted to move to other cells within the tree control, for editing purposes. This is accomplished using the [CellEditIntercept](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_CellEditIntercept) method, which defines keystrokes to be intercepted during cell editing using the [EditNavigating](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_EditNavigating) event. The CellEditIntercept method is normally used in the EditInitializing event to define cell navigation keys for the cell about to be edited. ### Cell Editing In Compatibility Mode > Cell editing using the methods and properties shown below should no longer be used as these are provided for compatibility with earlier versions of the product only. SftTree/OCX supports editing of cells using the built-in edit control or combo box control. SftTree/OCX will notify your application of certain events (such as double-clicking on a tree item). Your application can then start cell editing using an edit control ([StartEdit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_StartEdit) method) or a combo box control ([StartCombo](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_StartCombo), [StartComboEdit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_StartComboEdit) methods). SftTree/OCX will notify your application when editing is about to end, with or without data validation, by generating the [AfterEdit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_AfterEdit) and [PostEdit](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_PostEdit) events. Only the built-in edit control or combo box can be used for cell editing. There are two methods to handle cell editing events based on the [CellEventHandling](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_CellEventHandling) property: #### **CellEventHandling = False** If the user clicks a mouse button outside of the cell being edited or presses the TAB or ENTER key, the AfterEdit event is generated. This allows the application to perform input validation and other cleanup processing. If *Cancel* = False, the text selected replaces the cell's text. If *Cancel* = True, cell editing is not ended. If the user presses the ESCAPE key, cell editing is ended and the original cell text is restored. An AfterEdit event is not generated. Any data the user entered or selected is lost. Once cell editing has ended (or was aborted by the user), the PostEdit event is generated. #### **CellEventHandling = True** If the user clicks a mouse button outside of the cell being edited, the AfterEdit event is generated. This allows the application to perform input validation and other cleanup processing. If *Cancel* = False, the text selected replaces the cell's text. If *Cancel* = True, cell editing is not ended. The ENTER or TAB keys do not end cell editing and must be handled by the [CEKeyDown](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_CEKeyDown) or [CEKeyPress](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_CEKeyPress) event. Using these events, an application can implement cell motion, moving from one cell to the next in response to keystrokes. If the user presses the ESCAPE key, cell editing is ended and the original cell text is restored. An AfterEdit event is not generated. Any data the user entered or selected is lost. Once cell editing has ended (or was aborted by the user), the PostEdit event is generated. ## Content Windows *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_contentwindows* Each [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) can contain a child window. This child window becomes the content for the cell and is displayed in its place. Possible examples of such content windows are Windows Media Player, Web Browser controls, dialogs, etc. Almost any type of control or window can be used provided it can be represented by a window handle HWND. SftTree/OCX automatically resizes, hides and disables content windows as needed. A cell receives a content window by assigning its window handle using the [Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Cell).[AttachContentWindow](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_AttachContentWindow) method. > Limitations: [Tool Tips](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_tooltips) are not shown for cells based on a content window and content windows will not be printed when SftTree/OCX is used with SftPrintPreview/OCX. Excessive use of content windows may exhaust available system resources. The included ContentWindows sample demonstrates how various controls and dialogs can be embedded in the tree control. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/contents1small.gif) ## Columns *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columns* A SftTree/OCX tree control can define multiple columns (see [ColumnsObj](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ColumnsObj).[Count](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_Count)), each with its individual text alignment (see [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[CellHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellHAlign) and Column.[CellVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_CellVAlign)). A tree control can also define a header with titles, each with its individual text alignment. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) can be resized by the user without application program intervention (unless disabled by the application). By dragging the separator between titles (or buttons), users can adjust column widths to their particular needs. An application could save these column widths in an INI file or the registry for future use. Each column has a defined width (see Column.[Width](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_Width)). The last column can be defined as an [open-ended column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_OpenEnded) using the ColumnsObj.OpenEnded property. Using the ColumnsObj.OpenEnded property, the last displayed column can be defined as *open-ended*, which is the default if the application doesn't define any columns. An open-ended last column will display the complete text and graphics specified for the last (or only) column and never truncate any data. A *fixed-width* last column is defined with a specified width (see Column.Width) and any data which doesn't fit is truncated. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Display vs. Real Columns *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_displayvsrealcolumns* When allowing [column drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columndragdrop) to reorder columns, the user may see columns in an order other than the order in which an application sees the columns. An application always uses "real" columns in methods and properties. A column which was originally added as column 0 will always remain column 0 for method and property parameters, even if the column order has been changed and the column is no longer the first column displayed. This simplifies the application's programming logic as it can assume that the column position never changes. SftTree/OCX translates the real column number into the actual column number. The actual column number is referred to as the "display column" number. The display column number is identical to the order in which the columns are displayed. ### Translating Real Column to Display Column An application can retrieve a "real" column's "display" column number by inspecting the column information returned by [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[DisplayPosition](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_DisplayPosition). In this example, the real column number of the third column is translated to the display column number: ``` displayColumn = Tree1.Column(2).DisplayPosition ``` ### Translating Display Column to Real Column If an application needs to translate a display column number to a real column number, the [ColumnsObj](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ColumnsObj).[ColumnIndex](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ColumnIndex) property can be used. In this example, the display column number of the second displayed column is translated to the real column number: ``` realColumn = Tree1.ColumnsObj.ColumnIndex(1) ``` ## Column Headers *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders* The optional column header is available for single- and multi-column trees, with labeled buttons or just titles (see [Headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Headers).[Appearance](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeaders_Appearance)). Each header or button label may be left or right adjusted or centered within the column boundaries (see [Header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Header).[TextHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_TextHAlign) and Header.[TextVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_TextVAlign)). Column headers can contain graphics (see Header.[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_Image).[Picture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Picture)). Each column header can contain single or multiple lines of text (see Header.[Text](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_Text) and Headers.[Multiline](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeaders_Multiline)) and a graphic. The built-in column headers support text and one graphic for each column. All graphics must be the same height and width for all columns. Column headers support a [header dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dropdown) which takes up a portion of the header. Sort indicators can be added to column headers. If a user clicks on a column header, the application receives an [ItemClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemClick) or [ItemDblClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemDblClick) event with an *AreaType* of [constSftTreeColumnHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeAreaTypeConstants). Only one column header button can be in the pressed position at any one time (see Headers.[Pressed](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeaders_Pressed)). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Column Footers *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters* The optional column footer is available for single- and multi-column trees, with labeled buttons or just titles (see [Footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Footers).[Appearance](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooters_Appearance)). Each footer or button label may be left or right adjusted or centered within the column boundaries (see [Footer](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Footer).[TextHAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooter_TextHAlign) and Footer.[TextVAlign](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooter_TextVAlign)). Column footers can contain graphics (see Footer.[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooter_Image)). Each column footer can contain single or multiple lines of text (see Footer.[Text](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooter_Text) and Footers.[Multiline](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooters_Multiline)) and a graphic. The built-in column footers support text and one graphic for each column. All graphics must be the same height and width for all columns. Column footers support a [footer dropdown/filter button](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dropdown) which takes up a portion of the footer. If a user clicks on a column footer, the application receives an [ItemClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemClick) or [ItemDblClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemDblClick) event with an *AreaType* of [constSftTreeColumnFooter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeAreaTypeConstants). Only one column footer button can be in the pressed position at any one time (see Footers.[Pressed](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeFooters_Pressed)). ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/shortcut.gif) [Tree Components](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_treecomponents) ## Column Drag & Drop *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columndragdrop* SftTree/OCX can be enabled to allow users of the control to reorder columns by dragging a column and dropping it at the new position in the control. The application can define certain columns that must remain in their current position (see [Header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Header).[KeepPosition](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_KeepPosition)). [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) that must remain in their current position cannot be moved. As a user reorders columns, this is completely transparent to the application. An application still references [cells](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) and columns by the "real" column number, which is the original column number that the cell or column had before columns were reordered by the user. While columns appear in a new order after dragging a column to a new position, the application references cells and columns by their [real column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_displayvsrealcolumns) number which never changes. A user can drag a column by clicking the left mouse button on a [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) and, without releasing the mouse button, move the cursor to a new location. A vertical bar indicates the location where the column will be inserted. Once the correct position is reached, the user releases the mouse button. An application receives the [ColumnsReordered](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ColumnsReordered) event after the column positions have been changed. While a column drag & drop is in progress, the user can abort it by pressing the ESCAPE key. When using a [split tree control](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar), columns can only be reordered within one pane. They cannot be moved from one pane to the other. ## Column Resizing *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnresizing* A SftTree/OCX control can define multiple columns, each with its individual text alignment (left, right, center). A tree control can also define a header with titles, each with its individual text alignment. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) can be resized by the user without application program intervention (unless disabled by the application using [Headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Headers).[Resizable](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeaders_Resizable)). By dragging the separator between titles (or buttons), users can adjust column widths to their particular needs. An application receives the [ColumnSize](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ColumnSize) event as the column sizes change. If the user resizes a column and makes it so small that its column width becomes 0, the next column to the left may also be affected (made smaller) in the same resizing operation, based on the settings of the Headers.Resizable property. Columns can be defined with a minimum column width (see the [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[MinWidth](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_MinWidth) property). This will prevent the user from hiding a column. The user is unable to make the column smaller than the minimum width defined. However, an application can still make the column smaller using properties and methods such as Column.[MakeOptimal](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_MakeOptimal), etc. When a user is about to resize a column, the [ColumnSizeStarted](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ColumnSizeStarted) event occurs (as the user presses the left mouse button in the column resizing area, before the column width changes). As the column is resized, the ColumnSize event can occur multiple times. Once the user releases the mouse button used to resize the column, the [ColumnSizeEnded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ColumnSizeEnded) event occurs. These events also occur identically during [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar) resizing. If the resizing area of a [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) is double-clicked, an [ItemDblClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemDblClick) event occurs with an *AreaType* of [constSftTreeColumnRes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeAreaTypeConstants). The application can define certain columns as locked (see [Header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Header).[Locked](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeHeader_Locked)). Columns that are locked cannot be resized. This could be useful for columns that contain a graphic which always has the same width. By using Column.MakeOptimal once to calculate the optimal width of the column, the column is wide enough to display all of its data, so there is no need to allow the user to resize it. Locked columns are also useful to hide entire columns from a user, e.g., if a user does not have sufficient authorization to view some data, the application could still load all information into the control, yet hide selected columns by locking them and setting their width to 0. This simplifies program logic as the application can work with constant column numbers, yet the data is not shown to users with insufficient authority. An application could save column widths as they have been altered by a user in an INI file or the registry for future use, using the Columns.[Widths](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_Widths) property. ## Keyboard Interface *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_keyboardinterface* A tree control responds to the arrow keys, PgUp, PgDn, Up, Down, Home, End, etc. to change the [selected item](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_selections). Depending on the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[SelectionArea](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SelectionArea) setting used, the CONTROL key can be used to move the caret location without moving the current selection. Typing one or more alphanumeric characters while a tree control has the input focus will reposition the selection on a matching item, based on the Items.[CharSearchMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_CharSearchMode) and Items.[CharSearchColumn](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_CharSearchColumn) properties. Depending on the Items.SelectionArea setting used, the CONTROL key with arrow keys can be used to move the caret location without moving the current selection. **Left Arrow** - If the current item is an [expanded](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapseitems) parent item, the left arrow key will generate an [ItemClick](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ItemClick) (*AreaType* = [constSftTreeButton](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/constants_SftTreeAreaTypeConstants)) event to collapse the item. Otherwise, the left arrow key will change the current item to the item's immediate parent item. If [AutoRespond](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_AutoRespond) is set to True, the ItemClick event is automatically handled, resulting in the item being collapsed. If AutoRespond is set to False, the ItemClick event must be handled by the application. **Right Arrow** - If the current item is a collapsed parent item, the right arrow key will generate an ItemClick (*AreaType* = constSftTreeButton) event to expand the item. Otherwise, the right arrow key will change the current item to the first immediate [dependent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/pop_dependents) item. If AutoRespond is set to True, the ItemClick event is automatically handled, resulting in the item being expanded. If AutoRespond is set to False, the ItemClick event must be handled by the application. **+ (numeric keypad)** -** **If the current item is a collapsed parent item, the + key will generate an ItemClick (*AreaType* = constSftTreeButton) event to expand the item. Otherwise, the + key will have no effect. If AutoRespond is set to True, the ItemClick event is automatically handled, resulting in the item being expanded. If AutoRespond is set to False, the ItemClick event must be handled by the application. **- (numeric keypad)** -** ** If the current item is an expanded parent item, the - key will generate an ItemClick (*AreaType* = constSftTreeButton) event to collapse the item. Otherwise, the - key will have no effect. If AutoRespond is set to True, the ItemClick event is automatically handled, resulting in the item being collapsed. If AutoRespond is set to False, the ItemClick event must be handled by the application. *** (numeric keypad)** -** ** If the current item is a collapsed parent item, the * key will generate an ItemClick (*AreaType* = constSftTreeExpandAll) event to expand the item completely. Otherwise, the * key will have no effect. **RETURN** - The [HandleReturn](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_HandleReturn) property can be used to determine handling and support of the RETURN key. **SPACE BAR** -** **The space bar selects/deselects the current item (honoring the CONTROL and SHIFT keys). ## Scroll Tips *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_scrolltips* Scroll Tips are displayed when the user drags the vertical scroll bar's scroll box using the mouse. By default, the [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) text of the first displayed item in the client area (see the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[TopIndex](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_TopIndex) property) is shown as a [Tool Tip](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_tooltips) next to the scroll bar. An application can override the text displayed using the [ToolTipVScroll](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipVScroll) event. Scroll Tips are enabled using the Items.[ScrollTips](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ScrollTips) property. ## Tool Tips *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_tooltips* If the text or graphic components in a [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) are only partially visible, a Tool Tip may be displayed if the mouse cursor rests above the partially displayed area. The Tool Tip window then displays the complete cell text and cell graphic by extending the cell and overlaying adjacent windows. Once the mouse cursor is moved away from the cell, the Tool Tip disappears. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/tooltip1.gif) Tool Tips are enabled for each column individually (see [Column](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Column).[ToolTip](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumn_ToolTip)). It is also possible to display Tool Tips even if the cells are already completely visible (see [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[ToolTipAlways](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ToolTipAlways) property). The size of Tool Tips when grid lines are used can be defined using the Items.[ToolTipsUseEntireCell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ToolTipsUseEntireCell) property. The [background bitmap](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_background_bitmap) is not used when displaying cell Tool Tips. An application can override the text displayed using the [ToolTipCell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipCell) event. An application can provide Tool Tip text for a [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) using the [ToolTipColumnHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipColumnHeader) event. Tool Tip text for a [column footer](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters) is defined using the [ToolTipColumnFooter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_ToolTipColumnFooter) event. The delay after which Tool Tips are displayed and hidden can be defined using the Items.[ToolTipIntervalOn](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ToolTipIntervalOn) and Items.[ToolTipIntervalOff](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_ToolTipIntervalOff) properties. ## Progress Bars *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_progressbar* SftTree/OCX supports a simple progress bar display in each [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells). If enabled, the progress bar is rendered as cell background, with the cell text and image displayed in the cell as usual. For a partial height progress bar, the cell background is also rendered using the defined background colors. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/prog1.jpg) The [Cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Cell).[ProgressValue](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressValue) property defines the current value (between 0 and Cell.[ProgressMax](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressMax), inclusive) of the progress bar and the progress bar is rendered proportionally to the size of the cell. The progress bar for a cell is rendered using the colors defined with the Cell.[ProgressColor](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressColor) and Cell.[ProgressColorEnd](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressColorEnd) properties. The orientation of the gradient fill can be defined using the Cell.[ProgressColorOrientation](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressColorOrientation) property. The appearance of the progress bar can be defined with the Cell.[ProgressStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_ProgressStyle) property. A progress bar is only shown for the cell if its Cell.ProgressMax property is set to a value other than 0. ## Background Bitmap *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_background_bitmap* Instead of using the defined background colors for the tree control, a user-defined bitmap can be displayed in the client area of the tree control (see the [BackgroundPicture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_BackgroundPicture) property). If the background bitmap is too small to fill the entire client area of the tree control, it is tiled (depending on the [BackgroundStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_BackgroundStyle) property). The [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) area, row/[column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) area and column header do not display the background bitmap. These areas are not transparent. There is no default background bitmap. [Bitmap transparency](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_bitmap_transparency) is not used for the background bitmap. The background bitmap is not used when displaying [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) [Tool Tips](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_tooltips). ## GDI+ *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus* If GDI+ is available, the tree control supports additional features not otherwise available: - Image support for PNG, TIFF, JPEG, GIF, Exif, EMF+, EMF (GDI+ images) with full support for alpha-blended (translucent and semi-transparent) images (e.g., [NETImageObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_NETImageObject)) - Rounded outline rectangle with gradient fill for [selected items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_selections), highlighted items ([flyby highlighting](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_flybyhiglighting)) or [drop target](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_DropHighlight) items ([Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[OutlineStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_OutlineStyle)) - Transition effects for [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons) and tree lines are used when the mouse enters/leaves the tree control ([MouseOverTransitionEffect](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_MouseOverTransitionEffect)) ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/gdiplus1small.gif) GDI+ is always available on all supported Windows platforms. If GDI+ support is not available, the features are simply disabled and alternate presentation methods are used, if available. An application can test whether GDI+ is available using the [GDIPlusSupport](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_GDIPlusSupport) property. ## Bitmap Transparency *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_bitmap_transparency* SftTree/OCX automatically uses bitmap transparency for all bitmaps used throughout a tree control. When a bitmap is displayed, the background can show through portions of the bitmap. SftTree/OCX accomplishes this by dynamically modifying a copy of the bitmap to adjust for the background color. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/transparency_1.gif)![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/transparency_1b.gif) The top, left pixel of each bitmap is inspected as the bitmap is painted. The color of that pixel represents the bitmap's background color. This color is replaced throughout the bitmap with the actual background color. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/transparency_2.gif) If the bitmap image includes the top, left pixel, add an extra row or column of pixels to the bitmap, so the image does not include the top, left pixel. Bitmap transparency is only used for bitmaps and is not used for icons, images in an ImageList control, Windows metafiles, [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus) images (e.g, [NETImageObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_NETImageObject) property) or other images that can be represented by a [SftPictureObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftPictureObject) object. > **.NET** When [using SftTree/OCX with .NET](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet), bitmap transparency is only used for bitmaps loaded using the [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog). Any bitmaps converted from a PictureBox or an Image object will not use bitmap transparency. With .NET, the PictureBox control and Image objects support all image formats (gif, jpeg, ico, etc.) and are also supported by SftTree/OCX. Some of these image formats already define transparency and should be used if image transparency is desired. Bitmap transparency is fully automatic and cannot be turned off. ## Virtual Mode *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualmode* > SftTree/OCX supports "flat" lists only in virtual mode. Hierarchies cannot be represented in virtual mode. The tree control can be used to display flat lists (without hierarchy) with up to 2,000,000,000 items. Graphics, colors and all tree control data and attributes are provided by the [VirtualItem](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_VirtualItem) event, which the application must implement to use a [virtual data source](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualdatasource). This eliminates lengthy initialization when many items are to be displayed. Virtual mode is enabled using the [VirtualMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_VirtualMode) property. ## Virtual Data Source *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualdatasource* > SftTree/OCX supports "flat" lists only in [virtual mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualmode). Hierarchies cannot be represented in virtual mode. A tree control can be populated using conventional methods by adding items one at a time using the [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items).[Add](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Add) or Items.[Insert](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Insert) methods. While there is no built-in limit to the number of items added this way, the more items added, the longer it takes. If an application already has all items in memory or mapped to a database or some other data source from which items can readily be retrieved, there is no need to add all items to the tree control. By implementing the [VirtualItem](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_VirtualItem) event (the "virtual data source"), the application can provide item information to the tree control as it is needed. Usually, only items that are visible in the tree control window need to be retrieved, ranging from one item to maybe a dozen, depending on the size of the tree control. This results in essentially no time spent populating the tree control. Virtual mode is enabled using the [VirtualMode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_VirtualMode) property. The tree control can be used to display flat lists (without hierarchy) with up to 2,000,000,000 items. Graphics, colors and all tree control data and attributes are provided by the VirtualItem event. This eliminates lengthy initialization when many items are to be displayed. The VirtualItem event can provide all the information to SftTree/OCX, even [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) graphics, fonts, etc. Graphics are enabled using the [VirtualPictures](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_VirtualPictures) method. Some properties and methods are not available when a virtual data source is used. Most properties and methods which update item or cell information can not be used. The application cannot update items in the tree control, it must update its (external) data source instead. By using the provided methods [VirtualItemChanged](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_VirtualItemChanged) and [VirtualCount](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_VirtualCount), an application can notify the tree control that items or item count have been modified by the application. ## Using SftTree/OCX *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using* SftTree/OCX can be used with most development tools that support ActiveX controls. This section shows how to use the control with some of the most popular development tools. The control is automatically registered in the Windows Registry during installation of SftTree/OCX. Please see [Distributing SftTree/OCX](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_distributing) for information on how to ship the control with your application. Many development tools offer a palette or tool bar of available ActiveX controls. The control SftTree/OCX may be added to these tool bars automatically, or you may have to take additional steps to make the control available to a development tool or project. Check your development tool's documentation for detailed information on how to use ActiveX controls. - [Using SftTree/OCX with .NET](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet) (C#, VB.NET) - [Using SftTree/OCX with Visual Studio (Unmanaged C/C++)](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_vc7) - [Using SftTree/OCX with Visual Basic 6](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_vb6) - [Using SftTree/OCX with Other Development Tools](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_other) Once the SftTree/OCX control is available, it can be added to forms, dialogs or windows. By right clicking on the control in design mode, most development tools will display a popup menu which allows access to the Property Dialogs provided by SftTree/OCX. The Property Dialogs are used to define all design-time properties of the control. Some development tools also display their own property window. This property window normally displays only the properties of the [SftTree/OCX object](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/i_object_hierarchy). Other objects which the control may offer are not shown. These can only be modified though the Property Dialogs. The development tool's property window may provide access to the SftTree/OCX online help using the F1 key or a similar mechanism. The Property Dialogs offered by SftTree/OCX display context sensitive help by double-clicking on the description of a property or by right-clicking on any displayed property of the Property Dialogs. ## Using SftTree/OCX with .NET (C#, VB.NET) *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet* .NET Framework and .NET 10 Adding SftTree/OCX To The Toolbox Adding SftTree/OCX To A Project Adding The SftHelperComponent To A Project Preparing a Project Special Considerations - Indexed Properties - Picture Properties - Font Properties - Color Properties Object vs. Interface ### .NET Framework and .NET 10 SftTree/OCX can be used in both classic *.NET Framework* and *.NET 10* (or later) Windows Forms applications. In all cases the control is added to a form using the Visual Studio-generated AxSftTree wrapper, and the complete property, method and event API, including the [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog), is available. One difference applies to .NET 10 projects: the *SftHelperComponent* and the *OLECvt* conversion class described below are provided for .NET Framework only. In .NET 10 applications, assign images, fonts and colors using the control's native API instead - for example, load a [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) image directly with [LoadImage](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_LoadImage), or use the handle-based properties such as [BitmapHandle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_BitmapHandle). See the [Pictures Sample (C# .NET 10)](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_csnet10_pictures) for a complete .NET 10 example. See also [Visual Studio 2026 Notes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_vs2026) for designer behaviors specific to Visual Studio 2026. ### Adding SftTree/OCX To The Toolbox The controls are automatically added to the Visual Studio Toolbox in the toolbox group *"Softel vdm, Inc."*. If you ever need to add them to the toolbox by hand, use the simple procedure outlined in "[Adding Controls To The Visual Studio Toolbox](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_toolboxvs)". ### Adding SftTree/OCX To A Project The SftTree/OCX control can be added to a form, by locating the control in the toolbox group *"Softel vdm, Inc."*. It can be added to a form by clicking on the SftTree/OCX button of the toolbox, then clicking on the form or by dragging the SftTree/OCX button of the toolbox to the form. ![Adding SftTree/OCX](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/net/using1.gif) ### Adding The SftHelperComponent To A Project In order to be able to use .NET images, color and font properties, a small helper component must be added to each project that uses SftTree/OCX. This helper component assists in to converting OLE types to .NET types. The SftHelperComponent control can be added to a form, by locating the control in the toolbox group *"Softel vdm, Inc."*. It can be added to a form by clicking on the SftHelperComponent button of the toolbox, then clicking on the form or by dragging the SftHelperComponent button of the toolbox to the form. ![Adding SftHelperComponent](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/net/using2.gif) The component will not appear on the form, but will instead be shown as a component used by the form. ### Preparing a Project Add the following *Imports* and *using*** **statements to your project source file(s). This simplifies name resolution, makes most enumerated constants available and provides access to the OLECvt class. VB ``` Imports AxSftTreeLib80 Imports SftTreeLib80 Imports Softelvdm.OLEConvert ``` C# ``` using SftTreeLib80; using AxSftTreeLib80; using Softelvdm.OLEConvert; ``` All required steps have now been completed to use SftTree/OCX. For a complete example, add the following sample code to initialize the control: VB ``` Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ItemIndex = AxSftTree1.Items.Add("Item 1") ItemIndex = AxSftTree1.Items.Add("Item 2") AxSftTree1.get_Item(ItemIndex).Level = 1 ItemIndex = AxSftTree1.Items.Add("Item 3") End Sub ``` C# ``` private void Form1_Load(object sender, System.EventArgs e) { int itemIndex; itemIndex = axSftTree1.Items.Add("Item 1"); itemIndex = axSftTree1.Items.Add("Item 2"); axSftTree1.get_Item(itemIndex).Level = 1; itemIndex = axSftTree1.Items.Add("Item 3"); } ``` > In this example, the control is initialized at run-time using code. Of course it is also possible (and much easier) to set up all properties using the property pages. You can access the property pages by right-clicking on the control and select the *Properties...* entry of the popup menu. You can run the sample application and it displays a SftTree/OCX control with three items. After adding the control to the form, right click on the control and select the *Properties**...* entry of the popup menu. This displays the Property Dialog for the control. Please note that you can right-click on a property in a Property Dialog or double-click on the description of a property to access its complete help information. This control has many properties and methods which you can use. This is a very simple example and doesn't even begin to exploit the capabilities of this control. Please take a moment to familiarize yourself with the objects offered by the SftTree/OCX control. Each object represents a specific area of the control and can be fully customized. Also make sure to run the [demo](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_demo_application) which is included with this product and take a look at the included [samples](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples). ### Special Considerations When adding SftTree/OCX to a project, Visual Studio .NET generates a class wrapper to fully support an ActiveX control such as SftTree/OCX. Unfortunately, this class wrapper is slightly incomplete and generates initially unexpected function names for certain properties. However, these issues are easily resolved. #### Indexed Properties Indexed properties (i.e., properties which require additional parameters, such as an index) are converted into method calls with a get_ and set_ prefix. For example, the Item property, which requires a subscript (or item index), is used as follows: ``` AxSftTree1.get_Item(ItemIndex).Level = 1 ``` All other properties with additional parameters use a get_ and set_ prefix. The *Syntax* portion of each method, property and event shows the full syntax, including any prefix (such as get_ and set_, etc.). #### Picture Properties While some graphics properties are generated to use an Image type, many properties and methods do not. These use the OLE picture type stdole.IPictureDisp instead, which cannot directly be used with an Image type. The *Syntax* portion of each method, property and event shows the full syntax and required picture type (Image or stdole.IPictureDisp). The Image type can easily be converted into a stdole.IPictureDisp type using the provided class OLECvt. This class is added to each project using Softelvdm.OLEConvert (see Preparing a Project above). VB ``` Public Shared Function ToIPictureDisp(ByVal i As Image) As stdole.IPictureDisp Public Shared Function ToImage(ByVal pic As stdole.IPictureDisp) As Image ``` C# ``` public static stdole.IPictureDisp ToIPictureDisp(Image i); public static Image ToImage(stdole.IPictureDisp pic); ``` ToIPictureDisp returns a stdole.IPictureDisp pointer given an Image object. With this helper class in place, the [SftTreeCell.Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Image) property (for example) can now be used as follows: VB ``` AxSftTree1.get_Cell(0, 0).Image.Picture = OLECvt.ToIPictureDisp(PictureBox1.Image) ``` C# ``` axSftTree1.get_Cell(0,0).Image.Picture = OLECvt.ToIPictureDisp(pictureBox1.Image); ``` In this example, PictureBox1 is a PictureBox control, part of the form, containing an image. > If you are using the same image many times, make sure to convert it once only and use the saved stdole.IPictureDisp. Converting the same image many times will create multiple OLE [Picture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Picture) objects, which can deplete virtual storage and available systems resources. The *Syntax* section of picture properties typically shows *Get*, *Put* and *PutRef* forms. If both *Put* and *PutRef* are available, *PutRef* is the preferred form as it conserves resources and assigns a picture object reference to the control. *Put* causes the control to completely copy the picture object. #### Font Properties While some font properties are generated to use a Font type, many properties and methods do not. These use the OLE font type stdole.IFontDisp instead, which cannot directly be used with a Font type. The *Syntax* portion of each method, property and event shows the full syntax and required font type (Font or stdole.IFontDisp). The Font type can easily be converted into a stdole.IFontDisp type using the provided class OLECvt. This class is added to each project using Softelvdm.OLEConvert (see Preparing a Project above). VB ``` Public Shared Function ToIFontDisp(ByVal f As Font) As stdole.IFontDisp ``` C# ``` public static stdole.IFontDisp ToIFontDisp(Font f); ``` ToIFontDisp returns an stdole.IFontDisp pointer given a Font object. With this helper class in place, the [SftTreeCell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeCell).[Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Font) property (for example) can now be used as follows: VB ``` Dim NewFont As New Font("Times New Roman", 16, FontStyle.Regular) AxSftTree1.get_Cell(ItemIndex, 0).Font = OLECvt.ToIFontDisp(NewFont) ``` C# ``` Font NewFont = new Font("Times New Roman", 16, FontStyle.Regular); axSftTree1.get_Cell(0, 0).Font = OLECvt.ToIFontDisp(NewFont); ``` > If you are using the same font many times, make sure to convert it once only and use the saved stdole.IFontDisp. Converting the same font many times will create multiple OLE Font objects, which can deplete virtual storage and available systems resources. The *Syntax* section of font properties typically shows *Get*, *Put* and *PutRef* forms. If both *Put* and *PutRef* are available, *PutRef* is the preferred form as it conserves resources and assigns a font object reference to the control. Any change to the font object is reflected in the control also. *Put* on the other hand causes the control to completely copy the font object. #### Color Properties Color properties without parameters of the [SftTree object](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTree) use the .NET Color structure, but all other properties and objects (such as SftTreeCell, etc.) use the native type UInt32 (uint). Converting a .NET Color structure color to a UInt32 (OLE color value) and vice versa is easily accomplished using the provided class OLECvt. This class is added to each project using Softelvdm.OLEConvert (see Preparing a Project above). VB ``` Public Shared Function ToOleColor(ByVal clr As System.Drawing.Color) As UInt32 Public Shared Function ToColor(ByVal clr As UInt32) As System.Drawing.Color ``` C# ``` public static uint ToOleColor(System.Drawing.Color clr); public static System.Drawing.Color ToColor(uint clr); ``` The valid range for a color value is 0 to 16,777,215 (&HFFFFFF). The high order byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). If the high byte is not 0, the system colors as defined in Control Panel's settings are used. The Windows API GetSysColor defines all valid constants. Please see your development environment's documentation for applicable color constants. The *Syntax* portion of each method and property shows whether a Color structure or an OLE color value is used. Color Structure - VB ``` AxSftTree1.BackColor = SystemColors.Highlight AxSftTree1.BackColor = Color.Red AxSftTree1.BackColor = OLECvt.ToColor(&HFF) ' red Dim c As Color c = AxSftTree1.BackColor ``` Color Structure - C# ``` axSftTree1.BackColor = SystemColors.Highlight; axSftTree1.BackColor = Color.Red; axSftTree1.BackColor = OLECvt.ToColor(0x00000ff); // red Color c = axSftTree1.BackColor; ``` OLE Color Value - VB ``` AxSftTree1.get_Cell(0, 0).BackColor = OLECvt.ToOleColor(SystemColors.Highlight) AxSftTree1.get_Cell(0, 0).BackColor = OLECvt.ToOleColor(Color.Red) AxSftTree1.get_Cell(0, 0).BackColor = &HFF ' red Dim c As Color c = OLECvt.ToColor(AxSftTree1.get_Cell(0, 0).BackColor) ``` OLE Color Value - C# ``` axSftTree1.get_Cell(0,0).BackColor = OLECvt.ToOleColor(SystemColors.Highlight); axSftTree1.get_Cell(0,0).BackColor = OLECvt.ToOleColor(Color.Red); axSftTree1.get_Cell(0,0).BackColor = 0x00000ff; // red Color c = OLECvt.ToColor(axSftTree1.get_Cell(0,0).BackColor); ``` ### Object vs. Interface The main control is represented by an object of the SftTree class, but can also be represented by its ISftTree interface. The ISftTree interface can be retrieved using the [Direct](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Direct) property. Certain methods and properties have different names and return types, based on how they are accessed. While (for example) an object based on the SftTree class is mostly equivalent to the ISftTree interface exposed by the control, .NET can introduce minor differences. Such differences are shown in the *Syntax* section of the affected methods and properties. All other classes are identical to their interfaces and no distinction is made. The *Syntax* portion shows both forms, the class member and the interface method (the interface method is always marked with a Note indicator). If both forms are identical, only one entry is shown. #### VB, C# Some properties (particularly font and picture properties) may require different types. For example, the [Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Font) property accepts a System.Drawing.Font when accessed through a SftTree class object, but uses a stdole.IFontDisp interface pointer when accessed directly though the ISftTree interface pointer. stdole.IFontDisp can be provided using the OLECvt class. Some properties or methods use different names, depending on how they are accessed. For example, the [Refresh](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Refresh) method is named CtlRefresh when accessed through a SftTree class object. When accessed directly though the ISftTree interface pointer it is named Refresh. Other classes, such as SftTreeCell and [SftTreeHeaders](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeHeaders), make no distinction between the class and interface. The classes SftTreeCell and SftTreeHeaders are equivalent to their respective interfaces ISftTreeCell and ISftTreeHeaders. ## Adding Controls To The Visual Studio Toolbox *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_toolboxvs* The controls are automatically added to the Visual Studio Toolbox during installation of SftTree/OCX and are located in the toolbox group *"Softel vdm, Inc."*. The controls can also be added to the toolbox "manually" using the following simple procedure. Adding SftTree/OCX Adding The SftHelperComponent Component ### Adding SftTree/OCX To The Visual Studio Toolbox For Visual Studio 2019, 2022 and 2026 the controls are automatically added to the Visual Studio Toolbox in the toolbox group named *"Softel vdm, Inc."* and this section can be skipped. Otherwise, the SftTree/OCX control must be added to the toolbox before it can be used in a project. Open a form in your project in design view. Right-click anywhere on the Toolbox and select "Add Tab" from the popup menu. ![Adding SftTree/OCX](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using1.gif) This creates a new tab for the control to be added. To complete the new tab, enter a suitable tab label. In this example, we enter "*Softel vdm, Inc.*" and press Return. ![Add Tab - Label](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using2.gif) Once the tab has been added, we are ready to add controls to it. Right-click on the area below the tab heading and select "Choose [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items)..." (or Add/Remove Items... in older Visual Studio versions) from the popup menu. ![Choose Toolbox Items](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using3.gif) This will present the Choose Toolbox Items dialog, which is used to locate the ActiveX control you want to add. ![Select SftTree/OCX](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using4.gif) Finally, click OK and the control now appears in your Toolbox. ![SftTree/OCX Added To Toolbox](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using5.gif) ### Adding The SftHelperComponent Component For Visual Studio 2019, 2022 and 2026 the controls are automatically added to the Visual Studio Toolbox in the toolbox group named *"Softel vdm, Inc."* and this section can be skipped. Otherwise, the SftTree/OCX control must be added to the toolbox before it can be used in a project. Open a form in your project in design view. In the toolbox, locate the group "*Softel vdm, Inc.*", created when the SftTree/OCX control was added to the toolbox (see above). Right-click on the area below the tab heading and select "Choose Items..." (or Add/Remove Items... in older Visual Studio versions) from the popup menu. ![Choose Toolbox Items](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using6.gif) This will present the Choose Toolbox Items dialog, which is used to locate the .NET component you want to add. ![Browse .NET Framework Components](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using7.gif) The [SftHelperComponent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet) is located at C:\Program [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)\Common Files\Softelvdm\Softelvdm.Controls or C:\Program Files (x86)\Common Files\Softelvdm\Softelvdm.Controls on 64-bit Windows versions. Add the assembly Softelvdm.OCXHelperV2.dll. ![Browse Softelvdm.OCXHelperV2.dll](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using8.gif) Locate the assembly and click Open to accept. This will return you to the Choose Toolbox Items dialog which now shows the newly added assembly. ![Select Softelvdm.OCXHelperV2.dll](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using9.gif) Finally, click OK and the control now appears in your Toolbox. ![SftHelperComponent Added To Toolbox](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/toolboxvs/using10.gif) ## Visual Studio 2026 Notes *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_vs2026* The following notes describe behaviors you may encounter when [using SftTree/OCX](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using) in the Visual Studio 2026 Windows Forms designer, particularly with .NET 10 (or later) projects. These are limitations in the way Visual Studio 2026 hosts ActiveX controls in its designer and are **not** defects in SftTree/OCX. They affect ActiveX controls in general, and the control itself functions correctly in all cases. ### Control Verb Menu (Smart Tag) When the control is selected in the designer, the smart tag (the small flyout arrow menu attached to the control) and the control's verb entries may display garbled text prefixed with *AXVerbPrefix* instead of the expected *Properties...*, *Help* and *About* entries. This is a Visual Studio 2026 rendering issue - Visual Studio fails to resolve its own resource string when it displays the verbs of an ActiveX control. The entries still work as expected; for example, the first entry still opens the control's [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog). You can also right-click the control and select *Properties...* directly. ### Properties Window Categories In the Visual Studio 2026 *Properties* window (the property grid), the control's properties are listed without category grouping. Visual Studio 2026's designer does not display the property categories of an ActiveX control. To work with the control's properties in a fully organized form, use the control's property pages instead. Right-click the control and select *Properties...* (or use the *Properties...* verb on the control's menu). The property pages group all properties into tabbed pages by category and provide complete help for each property. ### Properties Window Property Pages Button (Wrench Icon) In the Visual Studio 2026 *Properties* window, the *Property Pages* toolbar button (the wrench icon) is always disabled and cannot be used to open the control's property pages. To open the property pages, use the control's own menu instead - right-click the control and select *Properties...* (or use the *Properties...* verb on the control's menu). ## Using SftTree/OCX with Visual Studio (Unmanaged C/C++) *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_vc7* Adding SftTree/OCX To The Toolbox Adding SftTree/OCX To A Project Special Considerations - Picture Properties - Font Properties - Color Properties This section describes how SftTree/OCX is typically used with unmanaged C/C++ and Visual Studio .NET. All interfaces offered by SftTree/OCX, such as [ISftTree](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTree), [ISftTreeItem](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeItem), etc. are implemented as dual interfaces. Using vtable binding is significantly more efficient than using the IDispatch interface. The approach presented here relies on the #import preprocessor directive available in Visual C++. ### Adding SftTree/OCX To The Toolbox The controls are automatically added to the Visual Studio Toolbox in the toolbox group *"Softel vdm, Inc."*. If you ever need to add them to the toolbox by hand, use the simple procedure outlined in "[Adding Controls To The Visual Studio Toolbox](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_toolboxvs)". ### Adding SftTree/OCX To A Project Typically, the control is used with an MFC based application (or ATL). For this example, a sample MFC based application is used, but any unmanaged C or C++ application developed using Visual C++ can use this approach. This sample is created using the MFC AppWizard. A dialog based application is generated. While it is possible to use SftTree/OCX in non-dialog windows, this is rarely the case. In order to use any ActiveX controls in an MFC based project, OLE control support has to be added to the project. This is accomplished automatically when using the Application Wizard (as long as ActiveX control support is selected), or can be added later in the CWinApp::InitInstance member function, by using the AfxEnableControlContainer() function. For more information on ActiveX controls and Visual C++ please see the Visual C++ documentation. #### Adding The Control The SftTree/OCX control can be added to a form, by locating the control in the toolbox group *"Softel vdm, Inc."*. It can be added to a form by clicking on the SftTree/OCX button of the toolbox, then clicking on the form or by dragging the SftTree/OCX button of the toolbox to the form. ![Adding SftTree/OCX](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/vc7/using1.gif) Resize the control to a suitable size. #### Adding A Member Variable Member variables for the control can be added using ClassWizard, or simply by adding the required definitions to your dialog implementation. #### "Manually" Adding A Member Variable Add a variable for the control to your dialog's header file. The control class is always CWnd: ``` public: CWnd m_Tree1; <<<<<<< ``` Add a DDX_Control entry to your dialog's DoDataExchange function. Make sure the [ID](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItem_ID) used matches the ID used in the dialog resource (IDC_SFTTREE1 in this example). ``` void CYourDialog::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_SFTTREE1, m_Tree1); <<<<<<<< } ``` #### Adding A Member Variable Using ClassWizard [Click](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_Click) on the control, then invoke the Add Member Variable Wizard using the menu command *Project*, *Add Variable...*. ![Class Wizard](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/vc7/using2.gif) Enter a variable name, an optional comment and click *Finish*. This will add the C++ wrapper classes needed to access SftTree/OCX. A number of C++ classes are generated for each object class supported by SftTree/OCX. The only wrapper class that is needed is the class CSftTree/OCX (based on the control's IDispatch interface). It is only needed to define the options control. Any other C++ classes generated can be discarded and are not used. #### Using #import Because the generated wrapper classes are **not** used, #import statements have to be added to Stdafx.h. The #import directive makes all interfaces and the associated methods and properties available to the application. ``` #pragma warning(disable : 4192) // automatically excluding 'Ixxx' while importing type library 'stdole2.tlb' // For information about the following construct, please see Microsoft's // KnowledgeBase entry Q224610 #import rename_namespace("SftTreeNameSpace") exclude("OLE_HANDLE", "OLE_COLOR", "IFontDisp", "IPictureDisp", "FONTSIZE") #ifdef _WIN64 #import rename_namespace("SftTreeNameSpace") rename("LoadImage", "LoadImageSftTree") \ exclude("LONG_PTR") #else #import rename_namespace("SftTreeNameSpace") rename("LoadImage", "LoadImageSftTree") \ exclude("LONG_PTR") #endif #if _MSC_VER >= 1400 // need at least Visual Studio 2005 # pragma comment(lib, "comsuppw.lib") // avoid link error in VS2005 #endif #pragma warning(default : 4192) using namespace SftTreeNameSpace; ``` SftTree/OCX controls are installed in the Windows System(32) directory. The #import statement generates two files (SftTree_x64_U_80.tlh and SftTree_x64_U_80.tli for 64-bit builds, or SftTree_IX86_U_80.tlh and SftTree_IX86_U_80.tli for 32-bit builds), which are automatically included into the source at the position of the #import directive. It does so by analyzing the type library which is built into the SftTree/OCX control. These files contain the definition of the methods and properties as shown in the *Syntax* section of each method and property. ``` VARIANT_BOOL Boolean = object->Enabled; ``` In addition, lower level function calls are also defined. ``` VARIANT_BOOL Boolean = object->GetEnabled(); void object->PutEnabled(VARIANT_BOOL Boolean); ``` The generated header files (SftTree_x64_U_80.tlh and .tli, or SftTree_IX86_U_80.tlh and .tli, depending on the build platform) should be used as a reference when using the functions and C++ properties. This documentation generally includes the higher level property variables and functions only. Some low-level functions are not shown and can only be found in the generated header files. Which style is used depends on your preference. Both styles are identical in functionality but some styles are easier to use. For example, the Enabled property can be set using any of the following styles: ``` ISftTreePtr vTree1 = m_Tree1.GetControlUnknown(); vTree1->Enabled = VARIANT_FALSE; ``` or ``` ISftTreePtr vTree1 = m_Tree1.GetControlUnknown(); vTree1->PutEnabled(VARIANT_FALSE); ``` For more information on smart pointers such as ISftTreePtr used above, please see the Visual C++ product documentation. #### Adding IntelliSense Help IntelliSense information is available for SftTree/OCX 8.0, but it is not automatically added to your projects. To "activate" IntelliSense help, add the generated header files SftTree_IX86_U_80.tlh and SftTree_IX86_U_80.tli to your project. IntelliSense is only available for files that are part of your project. Using the *Project, Add Existing Item... *menu command, locate the above header files in your project's directory or subdirectories and add these to your project. These files exist only after the project has been compiled at least once. All required steps have now been completed to use SftTree/OCX. #### Sample Initialization Add the following sample code to initialize the control in the OnInitDialog member function of the dialog: ``` ISftTreePtr vTree = m_Tree1.GetControlUnknown(); long itemIndex; itemIndex = vTree->Items->Add(_T("Item 1")); itemIndex = vTree->Items->Add(_T("Item 2")); vTree->Item[itemIndex]->Level = 1; itemIndex = vTree->Items->Add(_T("Item 3")); ``` > In this example, the control is initialized at run-time using code. Of course it is also possible (and much easier) to set up all properties using the [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog). You can access the property pages by right-clicking on the control and select the *Properties...* entry of the popup menu. You can run the sample application and it displays a SftTree/OCX control with three items. After adding the control to the form, right click on the control and select the *Properties**...* entry of the popup menu. This displays the Property Dialog for the control. Please note that you can right-click on a property in a Property Dialog or double-click on the description of a property to access its complete help information. This control has many properties and methods which you can use. This is a very simple example and doesn't even begin to exploit the capabilities of this control. Please take a moment to familiarize yourself with the objects offered by the SftTree/OCX control. Each object represents a specific area of the control and can be fully customized. Also make sure to run the [demo](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_demo_application) which is included with this product and take a look at the included [samples](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples). ### Special Considerations The #import statement generates two files (SftTree_x64_U_80.tlh and SftTree_x64_U_80.tli for 64-bit builds, or SftTree_IX86_U_80.tlh and SftTree_IX86_U_80.tli for 32-bit builds), which are automatically included into the source at the position of the #import directive. It does so by analyzing the type library which is built into the SftTree/OCX control. These files contain the definition of the methods and properties as shown in the *Syntax* section of each method and property. #### Picture Properties Applications written using C/C++ have direct access to Windows APIs and generally can manipulate bitmaps, icons and metafiles using Windows handles. ActiveX controls manipulate all pictures using the OLE [Picture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Picture) object represented by the IPicture and IPictureDisp interfaces. SftTree/OCX has full support for Windows handles and OLE Picture objects, so a C/C++ application can use its preferred picture representation. In addition, SftTree/OCX also support [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus), so an application can use GDI+ images directly using properties and methods such as [SftPictureObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftPictureObject).[Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Image) as SftPictureObject.[LoadImage](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_LoadImage). ##### Using Handles Most properties and methods have forms which directly accept picture handles as parameters. The [SftTreeCell.Image](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Image) property (for example) can be used as follows: ``` CBitmap m_Up; . . . m_Up.LoadBitmap(IDB_UP); . . . vTree->GetCell(0,0)->Image->PutPictureH((OLE_HANDLE)(HBITMAP) m_Bitmap); ``` ##### Using OLE Picture Objects OLE Picture objects can be created using Windows API functions, such as OleCreatePictureIndirect. ``` IPictureDispPtr pPic; PICTDESC PictDesc; PictDesc.cbSizeofstruct = sizeof(PICTDESC); PictDesc.picType = PICTYPE_BITMAP; PictDesc.bmp.hbitmap = (HBITMAP) bitmap_handle; PictDesc.bmp.hpal = NULL; HRESULT hr = OleCreatePictureIndirect(&PictDesc, __uuidof(pPic)/*IID_IPictureDisp*/, FALSE, (void**)&pPic); ASSERT(SUCCEEDED(hr)); . . . vTree->GetCell(0,0)->Image->PutRefPicture(pPic); ``` The *Syntax* section of picture properties typically shows *Get*, *Put* and *PutRef* forms. If both *Put* and *PutRef* are available, *PutRef* is the preferred form as it conserves resources and assigns a picture object reference to the control. *Put* causes the control to completely copy the picture object. #### Font Properties Fonts are represented using the OLE Font object and the IFontDisp interface. OLE Font objects can be created using the Windows API function OleCreateFontIndirect. The [SftTreeCell.Font](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeCell_Font) property (for example) can be used as follows: ``` FontPtr pFont = vTree->GetCell(0,0)->GetFont(); pFont->Name = _T("MS Sans Serif"); pFont->Weight = FW_BOLD; pFont->Italic = VARIANT_FALSE; CY size; size.int64 = 100000;// point size * 10000 pFont->Size = size; ``` The *Syntax* section of font properties typically shows *Get*, *Put* and *PutRef* forms. If both *Put* and *PutRef* are available, *PutRef* is the preferred form as it conserves resources and assigns a font object reference to the control. Any change to the font object is reflected in the control also. *Put* on the other hand causes the control to completely copy the font object. #### Color Properties The valid range for a color value is 0 to 16,777,215 (0xffffff). The high order byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (0xff). If the high byte is not 0, the system colors as defined in Control Panel's settings are used. The Windows API GetSysColor defines all valid constants. Please see your development environment's documentation for applicable color constants. ``` vTree->Items->BackColor = 0x80000000L | COLOR_HIGHLIGHT; vTree->Items->BackColor = 0x000000ffL; ``` ## Using SftTree/OCX with Visual Basic 6 *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_vb6* Adding SftTree/OCX To A Project Special Considerations - Color Properties ### Adding SftTree/OCX To A Project The SftTree/OCX control must be added to the Toolbox before it can be used in a project. The Toolbox normally displays the standard Visual Basic controls and any other ActiveX controls that have been added previously. ![New Project](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/vb6/using1.gif) The control is added to the Toolbox using the *Project*, *Components...* menu command, which displays the following dialog: ![Toolbox](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/vb6/using2.gif) Select the control "SftTree/OCX 8.0 Tree Control" by placing a check mark next to it and click OK. This adds the control to the Toolbox. If you don't see the control in the list, make sure *Selected Items Only* is not checked. Once you click Apply or OK and an error message is displayed, the product SftTree/OCX is not correctly installed or the control may have been unregistered accidentally. Quit Visual Basic and use the entry *Maintenance, Register SftTree OCX in Windows Registry in the SftTree OCX 8.0* program group to register the control. Restart Visual Basic and try to add the control to the Toolbox again. - ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/SftTree_16x16.gif) for use with **Visual Basic** (and other development tools) Now the control can be added to a form by clicking on the SftTree/OCX button of the Toolbox. ![Adding SftTree/OCX](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/vb6/using3.gif) All required steps have now been completed to use SftTree/OCX. Add the following sample code to initialize the control: ``` Private Sub Form_Load() Dim ItemIndex As Long With SftTree1 ItemIndex = .Items.Add("Item 1") ItemIndex = .Items.Add("Item 2") .Item(ItemIndex).Level = 1 ItemIndex = .Items.Add("Item 3") End With End Sub ``` > In this example, the control is initialized at run-time using code. Of course it is also possible (and much easier) to set up all properties using the [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog). You can access the property pages by right-clicking on the control and select the *Properties...* entry of the popup menu. You can run the sample application and it displays a SftTree/OCX control with three items. After adding the control to the form, right click on the control and select the *Properties**...* entry of the popup menu. This displays the Property Dialog for the control. Please note that you can right-click on a property in a Property Dialog or double-click on the description of a property to access its complete help information. This control has many properties and methods which you can use. This is a very simple example and doesn't even begin to exploit the capabilities of this control. Please take a moment to familiarize yourself with the objects offered by the SftTree/OCX control. Each Object represents a specific area of the control and can be fully customized. Also make sure to run the [demo](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_demo_application) which is included with this product and take a look at the included [samples](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples). ### Special Considerations #### Color Properties The valid range for a color value is 0 to 16,777,215 (&HFFFFFF). The high order byte of a number in this range equals 0; the lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number between 0 and 255 (&HFF). If the high byte is not 0, the system colors as defined in Control Panel's settings are used. The Windows API GetSysColor defines all valid constants. Please see your development environment's documentation for applicable color constants. ``` SftTree1.Items.BackColor = vbHighlight SftTree1.Items.BackColor = vbRed SftTree1.Items.BackColor = &HFF ' red ``` ``` Dim c As Long c = SftTree1.Items.BackColor ``` ## Using SftTree/OCX with Other Development Tools *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_other* SftTree/OCX is designed according to the latest ActiveX standards and can be used with a wide variety of development tools. While these are not documented here, the product can be used with most development tools that support ActiveX controls. Most development tools document how to use an ActiveX control, so you should be able to find information specific to your development tool in its documentation. While many development tools support ActiveX controls, some may encounter specific problems and restrictions. These can generally not be addressed by our control product. [Cell editing](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellediting) and [OLE drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop) in particular may be limited or unavailable. Our product fully supports most popular languages, such as Visual Basic, VB.NET, C#, Visual C++, Microsoft Access, etc. ## Syntax Conventions Used *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_syntax_used* The syntax shown in this documentation follows these guidelines. Each property, method and event is shown for Visual Basic .NET (VB.NET), Visual Basic 6 (VB), C# (C#.NET), Visual C++ (VC++) and C (C). The syntax for properties shows up to three forms (*Get*, *Put *and *PutRef*) if available, the first to retrieve the property value, the second and third to set the property value. For most properties, only a *Get* and *Put* syntax is shown. Font and picture properties also allow a third form (*PutRef*). If both * Put* and *PutRef* is available, *PutRef* is the preferred form as it conserves resources and assigns a font or picture object reference to the control. Any change to the font or picture object is reflected in the control also. *Put* on the other hand causes the control to completely copy the font or picture object. ### Syntax Get | | | | --- | --- | | VB.NET | *refPictureObj* = *object*.**[Picture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Picture)** **As stdole.IPictureDisp** | | VB | **Set** *refPictureObj* = *object*.**Picture** **As IPictureDisp** | | C#.NET | **stdole.IPictureDisp** *refPictureObj* = *object*.**Picture**; | | VC++ | **IPictureDisp*** *refPictureObj* = *object*->Get**Picture**(); | | C | **HRESULT** *object*->get_**Picture**(**IPictureDisp**** *refPictureObj*); | Put | | | | --- | --- | | VB.NET | *object*.let_**Picture**(**ByVal** *refPictureObj* **As stdole.IPictureDisp**) | | VB | *object*.**Picture** = *refPictureObj* **As IPictureDisp** | | C#.NET | **void** *object*.let_**Picture**(**stdole.IPictureDisp** *refPictureObj*); | | VC++ | **void** *object*->Put**Picture**(**IPictureDisp*** *refPictureObj*); | | C | **HRESULT** *object*->put_**Picture**(**IPictureDisp*** *refPictureObj*); | PutRef | | | | --- | --- | | VB.NET | *object*.**Picture** = *refPictureObj* **As stdole.IPictureDisp** | | VB | **Set** *object*.**Picture** = *refPictureObj* **As IPictureDisp** | | C#.NET | **stdole.IPictureDisp** *object*.**Picture** = *refPictureObj*; | | VC++ | **void** *object*->PutRef**Picture**(**IPictureDisp*** *refPictureObj*); | | C | **HRESULT** *object*->putref_**Picture**(**IPictureDisp*** *refPictureObj*); | If the [![\](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/help.gif)](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet) indicator is shown next to a type, it links to additional language-specific help. The following conventions are used throughout the reference section: | Description | Example | | --- | --- | | Syntax shown shows sample use of the property, method or event (VB.NET, VB, C#.NET) or shows its definition (VC++, C) | *refPictureObj* = *object*.**Picture** | | Syntax shown in this color shows the type of the property, return type of the method or event (VB.NET, VB, C#.NET) | **As stdole.IPictureDisp **
: **IPictureDisp** | | Words in bold (any color) indicate language keywords or (property, method, event) names. | **False
If Function
[BorderStyle](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_BorderStyle)** | | Italic words (any color) indicate placeholders for information, to be supplied by you. | *object
index
var* | | Words in regular font (any color) indicate text that is used as-is, such as language specific punctuation. | ->
get_ | | Square brackets (any color) indicate optional information when describing Visual Basic (VB). For all other languages, square brackets indicate array indices. | [, arg] | All code [samples](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples) are based on the source code found in the product directory \Program [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)\Softelvdm\SftTree OCX 8.0\Samples\. ## Property Dialogs *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog* Depending on the development environment used, the steps necessary to modify the control properties vary. The properties supported by the control can be displayed in a variety of ways. See your development environment's documentation for specific instructions. Usually, development tools allow access to the Property Pages implemented by a control. For example, Visual Basic allows you to right-click on the control in design mode. By selecting *Properties* from the popup menu presented, the properties can be accessed using the Property Pages provided by the control. The following tabs are offered by this property dialog. Additional tabs may be added to the dialog by your development tool. | Tab | Description | | --- | --- | | [Attributes](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_attributes) | Defines the main attributes of the control. | | [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columns) | Defines basic attributes for all columns. | | [ColumnList](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columnlist) | Defines the attributes for each individual column. | | [Headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_headers) | Defines basic attributes for all [column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders). | | [Header List](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_headerlist) | Defines the attributes for each individual column header. | | [Footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_footers) | Defines basic attributes for all [column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters). | | [Footer List](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_footerlist) | Defines the attributes for each individual column footer. | | [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_items) | Defines basic attributes for all items. | | [Item List](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_itemlist) | Defines the attributes for each individual item. | | [Row Headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowheaders) | Defines basic attributes for all [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders). | | [Row/Column Header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowcolumnheader) | Defines the attributes for the row/column header. | | [Row/Column Footer](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowcolumnfooter) | Defines the attributes for the row/column footer. | | [Splitter Bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_splitterbar) | Defines the attributes for the [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar). | | [Load/Save](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_loadsave) | [Load](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Load)/save property settings. | | [Options](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_options) | Defines property page dialog options. | | [Updates](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_updates) | Download free product maintenance and updates | Each tab and associated page allows a set of properties to be manipulated. All properties are labeled using the property name. Detailed descriptions can be found in the on-line help. ### Help Most pages offer on-line help by clicking on the Help button. This Help button may not be displayed when using certain development environments. Other means may be available to view the product's on-line help. ### Property Pages Each property page shows a number of properties using categories (such as Appearance, Behavior, Colors, etc.). By clicking on a property, the property can be edited. Using the TAB (or SHIFT+TAB) key the next (or previous) property can be edited or simply click on another property. Double-click on the description of a property to display the complete help information or right-click on the property grid for a help menu. ### Color Properties When clicking on a property representing a color value, a combo box is displayed which shows the available system colors as defined using Control Panel and also the basic colors. A new color value can be selected from the choices offered or a new color value can be entered. The following syntax is accepted: | | | | --- | --- | | &H00*bbggrr*& | A hexadecimal number (Visual Basic style) | | 0x00*bbggrr* | A hexadecimal number (C/C++ style) | | *decimal* | A decimal value, the decimal equivalent of a hexadecimal color value
*bb* = blue component
*gg* = green component
*rr* = red component | #### Example: &H00FF0000& Blue 0x0000ff00 Green The display format of color values can be modified using the Options page. ### Image Properties An image property (based on a [SftPictureObject](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftPictureObject) object class) can be defined by clicking on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells). This displays a dialog that is used to load a bitmap, [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus) image, icon or metafile, built-in image or color sample. Some properties only allow bitmaps or only icons. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/propimage.gif) If a file has been loaded, the image is saved along with the control properties and the file is no longer required. Image properties display (None), (GDI+ Image), ([Picture](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Picture)), (Built-In), (Color Sample) or (Invalid [Type](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftPictureObject_Type)), depending on the graphic type loaded. To clear an image property click on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the cell, then click Clear on the resulting dialog. This will clear the image property. ### Picture Properties A Picture property can be defined by clicking on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the cell. This displays a dialog that is used to load a bitmap, icon or metafile. Some properties only allow bitmaps or only icons. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/proppicture.gif) Once a file has been loaded, the image is saved along with the control properties and the file is no longer required. Picture properties display (None), (Bitmap), (Metafile), (Icon) or (Invalid Type), depending on the graphic type loaded. To clear a Picture property click on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the cell, then click Cancel on the resulting dialog. This will clear the Picture property. ### Font Properties A Font property can be defined by clicking on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the cell. This displays a dialog that is used to define the attributes of the font. Certain font properties also support the use of a default font. To restore the default font, right-click on the ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/dropbutt.gif) bitmap of the cell and select the *Reset* menu entry. ## Attributes - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_attributes* Defines the main attributes of the control. Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTree](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTree) Object ## Columns - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columns* Defines basic attributes for all columns. Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeColumns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeColumns) Object ## ColumnList - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columnlist* Defines the attributes for each individual column. [Click](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_Click) on a [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) to display the complete help information for the selected property or right-click on a specific property for a help menu. Each row in the displayed grid represents one column. Use the Add or Delete buttons to add or delete columns. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) can be reordered using [drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop). Use the [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) (the small button at the very left of each entry) and drag it to a new position. Additional columns can also be added on the Columns [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) by changing the [ColumnsObj](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_ColumnsObj).Count property. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeColumn](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeColumn) Object ## Headers - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_headers* Defines basic attributes for all [column headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeHeaders](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeHeaders) Object ## Header List - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_headerlist* Defines the attributes for each individual [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders). [Click](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_Click) on a column header to display the complete help information for the selected property or right-click on a specific property for a help menu. Each row in the displayed grid represents one column header. Use the Add or Delete buttons to add or delete columns. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) can be reordered using [drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop). Use the [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) (the small button at the very left of each entry) and drag it to a new position. Additional columns can also be added on the [Columns property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columns) by changing the [ColumnsObj.Count](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_Count) property. For general information on how to use [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog), please see Property Dialogs. See Also [SftTreeHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeHeader) Object ## Footers - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_footers* Defines basic attributes for all [column footers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeFooters](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeFooters) Object ## Footer List - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_footerlist* Defines the attributes for each individual [column footer](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters). [Click](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_Click) on a column footer to display the complete help information for the selected property or right-click on a specific property for a help menu. Each row in the displayed grid represents one column footer. Use the Add or Delete buttons to add or delete columns. [Columns](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Columns) can be reordered using [drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop). Use the row footer (the small button at the very left of each entry) and drag it to a new position. Additional columns can also be added on the [Columns property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_columns) by changing the [ColumnsObj.Count](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeColumns_Count) property. For general information on how to use [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog), please see Property Dialogs. See Also [SftTreeFooter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeFooter) Object ## Items - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_items* Defines basic attributes for all items. Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeItems](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeItems) Object ## Item List - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_itemlist* Defines the attributes for each individual item and [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells). Each row in the displayed grid represents one item. Use the Add, [Insert](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_Insert) or Delete buttons to add or delete items. [Items](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Items) can be repositioned using the left, up, right, down buttons. Right-clicking on a cell presents a context menu, allowing access to the cell, [row header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders) and item properties. Left-clicking on the row header of the item grid displays a context menu allowing access to all cells, row header and item properties. When changing cell graphics sizes, label graphics sizes, row header graphics sizes or cell graphics sizes in a [fixed height](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_fixedvariableitems) tree control, the existing graphics need to be removed using the *Go* button first. ![](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/itemlist1.gif) For general information on how to use [property pages](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog), please see Property Dialogs. See Also [SftTreeItem](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeItem) Object ## Row Headers - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowheaders* Defines basic attributes for all [row headers](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_rowheaders). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeRowHeaders](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeRowHeaders) Object ## Row/Column Header - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowcolumnheader* Defines the attributes for the row/[column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeRowColumnHeader](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeRowColumnHeader) Object ## Row/Column Footer - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_rowcolumnfooter* Defines the attributes for the row/[column footer](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnfooters). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeRowColumnFooter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeRowColumnFooter) Object ## Splitter Bar - Property Page *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_splitterbar* Defines the attributes for the [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar). Double-click on the description of a property to display the complete help information or right-click on the [property dialog](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) for a help menu. For general information on how to use property pages, please see Property Dialogs. See Also [SftTreeSplitter](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/index_SftTreeSplitter) Object ## Options - Property Dialog *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_options* The Options dialog allows you to change defaults of the [property dialogs](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog). Switching between different size property pages will not take effect until the property pages are ** closed and reopened**. Some IDE's (Visual Studio 6.0) must be closed and restarted before the changes take effect. Checking for available updates requires an Internet connection. Certain systems settings and site firewalls may prevent automatic update checking. In that case, use the Updates property page instead to check for available updates. ## Load/Save - Property Dialog *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_loadsave* The [Load](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Load)/[Save](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTree_Save) buttons are used to load or save the settings for the currently selected control. This is best used to transfer settings between different controls (of the same type). It is not necessary to save controls that are on a form as these settings are automatically saved when the form is saved. Using the Load/Save [property page](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_property_dialog) is usually only used when you need to transfer settings between already existing controls. For general information on how to use property pages, please see Property Dialogs. ## Updates - Property Dialog *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/r_props_updates* [Click](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeEvents_Click) on the "Free Updates..." button to download free product maintenance and updates from our web site. The product will contact our web site and check whether a newer version of the product is available. If product maintenance is available, you can download and install it automatically. Internet access is required to use the automatic download and update feature provided by this product. ## Demo Application *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_demo_application* During the installation of SftTree/OCX, an icon for the demo application "Demo" is installed in the program group *SftTree OCX 8.0*. This demo application shows some of the features available in SftTree/OCX. It is also used to access other [samples](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples) included in the demo or product and the online help. ![Demo Application](https://softelvdm.com/Vault/Softelvdm.com/docx/SftTree%20OCX%208.0/image/demo1.png) > All sample programs and complete sample source code can be found in the directory \Program [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)\Softelvdm\SftTree OCX 8.0\Samples or \Program Files (x86)\Softelvdm\SftTree OCX 8.0\Samples (64-bit Windows versions). Each sample is installed in its own subdirectory. All samples are supplied with a precompiled executable (EXE) and an entry is added to the *SftTree OCX 8.0* program group for each sample. ## Samples *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_samples* SftTree/OCX includes sample code for VB.NET, C# (including a .NET 10 sample), C++/MFC and VB6. Even though C samples are not included, the Syntax section for properties, methods and events also shows the C syntax. The following samples can be found in the folder C:\Program [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)\Softelvdm\SftTree OCX 8.0\Samples: ### VB.NET | Sample | Description | | --- | --- | | [VB.NET BookTable Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_booktable) | Illustrates [sorting](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/SftTreeItems_SortDependents), [column reordering](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columndragdrop), responding to [column header](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_columnheaders) clicks, context menus, controlling [expand/collapse buttons](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_expandcollapsebuttons) and plus/minus graphics. | | [VB.NET CellEditing Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_cellediting) | Illustrates [cell editing](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellediting) using edit controls and combo boxes, [cell](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cells) navigation, uneditable cells, checkbox cell image. | | [VB.NET CellEditingII Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_celleditingii) | Illustrates cell editing using ActiveX controls. | | [VB.NET ContentWindows Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_contentwindows) | Illustrates [content windows](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_contentwindows) using Windows Media Player, Internet Explorer controls and forms. | | [VB.NET DragDrop Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_dragdrop) | Illustrates [drag & drop](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_dragdrop). | | [VB.NET Email Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_email) | Illustrates using a [splitter bar](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_splitterbar), [cell merging](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_cellmerging), cell images, sorting, column reordering. | | [VB.NET ListFont Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_listfont) | Illustrates cell fonts. | | [VB.NET Pictures Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_pictures) | Illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, [progress bars](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_progressbar) and more. | | [VB.NET Virtual Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vbnet_virtual) | Illustrates using [virtual mode](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_virtualmode) with cell editing. | ### C# | | | | --- | --- | | [C# BookTable Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_booktable) | Illustrates sorting, column reordering, responding to column header clicks, context menus, controlling expand/collapse buttons and plus/minus graphics. | | [C# CellEditing Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_cellediting) | Illustrates cell editing using edit controls and combo boxes, cell navigation, uneditable cells, checkbox cell image. | | [C# CellEditingII Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_celleditingii) | Illustrates cell editing using ActiveX controls. | | [C# ContentWindows Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_contentwindows) | Illustrates content windows using Windows Media Player, Internet Explorer controls and forms. | | [C# DragDrop Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_dragdrop) | Illustrates drag & drop. | | [C# Email Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_email) | Illustrates using a splitter bar, cell merging, cell images, sorting, column reordering. | | [C# ListFont Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_listfont) | Illustrates cell fonts. | | [C# Pictures Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_pictures) | Illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, progress bars and more. | | [C# Virtual Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cs_virtual) | Illustrates using virtual mode with cell editing. | ### C# (.NET 10) | | | | --- | --- | | [C# .NET 10 Pictures Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_csnet10_pictures) | Illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, progress bars and more, hosted in a .NET 10 Windows Forms application. | ### C++ | | | | --- | --- | | [C++ BookTable Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_booktable) | Illustrates sorting, column reordering, responding to column header clicks, context menus, controlling expand/collapse buttons and plus/minus graphics. | | [C++ CellEditing Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_cellediting) | Illustrates cell editing using edit controls and combo boxes, cell navigation, uneditable cells, checkbox cell image. | | [C++ CellEditingII Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_celleditingii) | Illustrates cell editing using ActiveX controls. | | [C++ ContentWindows Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_contentwindows) | Illustrates content windows using Windows Media Player, Internet Explorer controls and forms. | | [C++ DragDrop Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_dragdrop) | Illustrates drag & drop. | | [C++ Email Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_email) | Illustrates using a splitter bar, cell merging, cell images, sorting, column reordering. | | [C++ ListFont Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_listfont) | Illustrates cell fonts. | | [C++ Pictures Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_pictures) | Illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, progress bars and more. | | [C++ Virtual Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_virtual) | Illustrates using virtual mode with cell editing. | | [C++ Speed Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_cpp_speed) | Tests the tree control's performance when adding and deleting large numbers of items. | ### VB6 | | | | --- | --- | | [VB6 BookTable Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_booktable) | Illustrates sorting, column reordering, responding to column header clicks, context menus, controlling expand/collapse buttons and plus/minus graphics. | | [VB6 CellEditing Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_cellediting) | Illustrates cell editing using edit controls and combo boxes, cell navigation, uneditable cells, checkbox cell image. | | [VB6 CellEditingII Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_celleditingii) | Illustrates cell editing using ActiveX controls. | | [VB6 ContentWindows Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_contentwindows) | Illustrates content windows using Windows Media Player, Internet Explorer controls and forms. | | [VB6 DragDrop Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_dragdrop) | Illustrates drag & drop. | | [VB6 Email Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_email) | Illustrates using a splitter bar, cell merging, cell images, sorting, column reordering. | | [VB6 ListFont Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_listfont) | Illustrates cell fonts. | | [VB6 Pictures Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_pictures) | Illustrates using bitmaps, images, imagelists, checkboxes, radiobuttons, color samples, progress bars and more. | | [VB6 Virtual Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_virtual) | Illustrates using virtual mode with cell editing. | | [VB6 XMLLoadSave Sample](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/samples_vb6_xmlloadsave) | Illustrates saving the tree control's contents to an XML file and loading them back, using flat and nested XML formats. | ## Distributing SftTree/OCX *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_distributing* This section describes the preferred distribution method when shipping SftTree/OCX with your application. This method follows Microsoft's guidelines on ActiveX control distribution. While these guidelines are not enforced, it is highly recommended that they are followed as outlined here. This insures that your application can be safely installed and use SftTree/OCX even if another vendor has already installed an application which also uses SftTree/OCX. > Supported platforms include Windows 10, Windows 11 and their server editions. ### Installing SftTree/OCX (for an Application) When distributing SftTree/OCX with your application, only the following files can be distributed with your application royalty-free. These files allow the use of the control with your application. The design-time interface is no longer available once SftTree/OCX is shipped with your application. For additional information regarding distributing this control with your application, see the license agreement. ### Required Files **Important:*** *Redistributable files are located in the SftTree/OCX installation directory (\Program [Files](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/DataObject_Files)\Softelvdm\SftTree OCX 8.0\Redist). These files must be shipped with your application if SftTree/OCX is used: | File Name | Target Folder | Description | | --- | --- | --- | | SftTree_IX86_U_80.ocx | See Control Target Directory below | **Required for 32-bit applications.** SftTree/OCX control. When distributing a managed .NET application compiled for "Any CPU", the 32-bit and 64-bit control must be distributed. | | SftTree_x64_U_80.ocx | See Control Target Directory below | **Required for 64-bit applications.** SftTree/OCX control. When distributing a managed .NET application compiled for "Any CPU", the 32-bit and 64-bit controls must be distributed. | | Softelvdm.OCXHelperV2.dll | See [SftHelperComponent](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using_dotnet) Target Directory below | **Required for managed .NET applications ONLY.** This .NET component is required when distributing managed .NET applications. It is not used for other (unmanaged) languages, like VC++, VB6, etc. This file requires the .NET Framework 4.8 runtime (or newer), which ships with Windows. If your application is a managed .NET application, this file needs to be distributed with your application. | | Softelvdm.NETHelper.dll | Application Folder | **Required for .NET 4.0 and above ONLY - Applications compiled for "Any CPU" or "x86".** This dll is required when distributing managed .NET applications. It is not used for other (unmanaged) languages, like VC++, VB6, etc. This file is required if your application uses the .NET 4.0 runtime or newer and is compiled for "Any CPU" or "x86". If your application is compiled for "Any CPU" you will need both Softelvdm.NETHelper.dll and Softelvdm.NETHelper_x64.dll. | | Softelvdm.NETHelper_x64.dll | Application Folder | **Required for .NET 4.0 and above ONLY - Applications compiled for "Any CPU" or "x64".** This dll is required when distributing managed .NET applications. It is not used for other (unmanaged) languages, like VC++, VB6, etc. This file is required if your application uses the .NET 4.0 runtime or newer and is compiled for "Any CPU" or "x64". If your application is compiled for "Any CPU" you will need both Softelvdm.NETHelper.dll and Softelvdm.NETHelper_x64.dll. | | Oleaut32.dll | \Windows\System32 or \Windows\SysWow64 | Required. OLE support. While normally present, the installation must insure that the current version is installed. This file is also needed by the container (VB, VC++, etc.) to support OLE and any ActiveX control. | | Olepro32.dll | \Windows\System32 or \Windows\SysWow64 | Required. OLE property and standard types support. While normally present, the installation must insure that the current version is installed. This file is also needed by the container (VB, VC++, etc.) to support OLE and any ActiveX control. | | Stdole2.tlb | \Windows\System32 or \Windows\SysWow64 | Required. OLE support. While normally present, the installation must insure that the current version is installed. This file is also needed by the container (VB, VC++, etc.) to support OLE and any ActiveX control. | | Asycfilt.dll | \Windows\System32 or \Windows\SysWow64 | Required. OLE support. While normally present, the installation must insure that the current version is installed. This file is also needed by the container (VB, VC++, etc.) to support OLE and any ActiveX control. | | Comcat.dll | \Windows\System32 or \Windows\SysWow64 | Required. OLE support. While normally present, the installation must insure that the current version is installed. This file is also needed by the container (VB, VC++, etc.) to support OLE and any ActiveX control. | | Regsvr32.exe | any | Optional. Control registration utility, for "manual" registration. Not needed with most commercial Setup creation tools. | ### GDI+ (Optional) Certain features of the control require [GDI+](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_gdiplus) support. GDI+ is available automatically on all supported Windows platforms. If GDI+ support is not available, the features are simply disabled and alternate presentation methods are used, if necessary. ### Control Target Directory Depending on the target operating systems, one of the following target directories can be chosen. #### A) Windows\System(32) Installing the ActiveX control into the Windows\System32 directory (or Windows\SysWOW64 for 32-bit controls on Windows x64) is possible on all supported Windows platforms. The setup program you provide with your application should install the SftTree/OCX control SftTree_IX86_U_80.ocx into the Windows System32 directory. The Windows System directory name can be found using the GetSystemDirectory API function. All other files shown in the above tables also have to be installed into the Windows System32 directory, usually named C:\Windows\System32 (or Windows\SysWOW64 for 32-bit controls on Windows x64). The control is installed into the Windows/System(32) directory and registered using proper versioning and reference counting of the OCX file (usually automatic, with most commercial installers). #### B) Application Directory An ActiveX control can be installed in the application directory using DLL/COM redirection. DLL/COM redirection is activated on an application-by-application basis by the presence of a ".local" file. The ".local" file is an empty file in the same directory as the application's .exe file, with the same name as the application's .exe file with ".local" appended to the end of the name. For example, to activate DLL/COM redirection for an application called "SampleApp.exe", create an empty file called "SampleApp.exe.local" in the same directory where SampleApp.exe is installed. "Registration-Free Activation" (see below) can be used, which eliminates the need for the ".local" file. Once DLL/COM redirection is activated, whenever the application loads a DLL or an OCX, Windows looks first for the DLL or OCX in the directory where the application's .exe file is installed. If a version of the DLL or OCX is found in the directory where the application's .exe file is installed, the application uses it regardless of any directory path specified in the application or the registry. If a version of the DLL or OCX is not found in the directory where the application's .exe file is installed, the normal search path or server path is used. Even if DLL/COM redirection is used, the control must be registered during installation (see "Registering SftTree/OCX" below). The control must be installed into the Windows/System(32) directory and registered using proper versioning and reference counting of the OCX file (usually automatic, with most commercial installers). In addition, a private copy in your application directory is always installed (but not registered), along with the application's ".local" file. ### SftHelperComponent Target Directory The SftHelperComponent (see "Using SftTree/OCX with .NET") is used by .NET applications. Earlier releases of SftTree/OCX required this component to be registered using Regasm.exe for COM Interop. This is no longer required. Simply copy the file Softelvdm.OCXHelperV2.dll to one of the following locations. They are listed in the order they are searched. Softelvdm.OCXHelperV2.dll: - Same folder where the ActiveX control is installed (see Control Target Directory above) - \Program Files\Common Files\Softelvdm\Softelvdm.Controls or \Program Files (x86)\Common Files\Softelvdm\Softelvdm.Controls (32-bit applications on 64-bit Windows versions only) - \Windows\System32 \Windows\SysWow64 (32-bit applications on 64-bit Windows versions only) The actual path (\Program Files or \Windows) may differ due to localization. ### Version Control The setup program should only install the SftTree/OCX files if the version number in the new files is higher than the files already installed. Maintenance releases of the product are fully upward compatible and are guaranteed to have a newer version number. New versions of the product will use new file names and new GUIDs so there will be no conflict between different (major) versions, such as 6.0, 7.0 and 8.0. ### Reference Counting When installing DLLs or OCX files into a "shared" location, such as the Windows\System(32) or \Windows\SysWOW64 directory, proper reference counting must be performed, to insure that the file isn't uninstalled until all applications making use of the DLL or OCX have also been uninstalled. Reference counting is generally available with most commercial installers. The Windows Registry contains a count of all such shared files in the following Registry location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs ### Registering SftTree/OCX Depending on the target operating systems, one of the following ActiveX/COM registration methods can be selected. #### A) Windows Registry Registering the ActiveX control in the Windows Registry is possible on all supported Windows platforms. The setup program should register SftTree/OCX in the Windows registration database (Registry). This can be done manually using Regsvr32.exe which is discouraged. Many commercially available setup programs can register SftTree/OCX during the installation of your application. Please keep in mind that 64-bit versions of Windows have two versions of RegSvr32.exe. \Windows\System32\RegSvr32.exe is used to register 64-bit controls and \Windows\SysWOW64\RegSvr32.exe is used to register 32-bit controls. RegSvr32.exe must be run with elevated privileges as administrator. SftTree/OCX is a self-registering ActiveX control. By using the LoadLibrary Windows API function, the GetProcAddress API can be used to obtain the DllRegisterServer function. By calling this function, the SftTree/OCX control will register itself with the Windows registration database (Registry). Most commercially available setup programs have support for this built-in. Check the documentation of your setup application for information on how to install ActiveX controls. Please keep in mind that an application using the LoadLibrary API can only load the control of the same machine type, meaning a 32-bit application can only load and register 32-bit controls, a 64-bit application can only load 64-bit controls. The following files need to be registered in this manner: | File Name | Description | | --- | --- | | SftTree_IX86_U_80.ocx | Required for 32-bit applications. SftTree/OCX control | | SftTree_x64_U_80.ocx | Required for 64-bit applications. SftTree/OCX control | | Comcat.dll | OLE support | | Oleaut32.dll | OLE support | | Olepro32.dll | OLE support | #### B) Registration-Free Activation It is possible to deploy this ActiveX control using "Registration-Free Activation". Registration-free activation allows distribution of the control without the requirement to register the ActiveX control in the Windows Registry (using REGSVR32 or a Setup application). Registration-free activation is supported by the operating system, so the .NET run-time is not required for registration-free activation. By using registration-free activation, true XCOPY deployment is possible. Your application uses its own copy of the control. Versioning, reference counting and registration of the control are completely eliminated and other installed versions of the control cannot interfere with your application. By using an application manifest and copying the OCX file SftTree_IX86_U_80.ocx and/or SftTree_x64_U_80.ocx into your application directory, the ActiveX control is automatically registered when it is used the first time. Your application manifest must include the comClass and typelib definitions shown below. These insure that your application automatically registers the control and uses the control located in your application directory, regardless of any other controls or other versions of the same control already installed or in use. ``` SftTree Sample Application ``` ### Testing a Setup Program If you test the installation of your application's Setup program on a system where the development version of SftTree/OCX is installed, you may notice that you can no longer use SftTree/OCX in your development environment. This is caused by the fact that your Setup program installed a "run-time only" control on your system, which has replaced the "design-time" or development version of SftTree/OCX. You can reinstate (or re-register) the design-time version of SftTree/OCX by using the program entry *"Maintenance, Register SftTree OCX in Windows Registry"* in the *SftTree OCX 8.0* program group. ## Technical Support *Source: https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_contactsoftel* ### Product Updates New major versions and product maintenance are available with an active [support subscription](https://softelvdm.com/About/Support%20Subscription). Your product purchase includes the first year's support subscription at no extra charge. After the first year, the support subscription can be renewed for continued availability of major versions and product maintenance. While your support subscription is active, free product maintenance for the current release is available from our web site. Such free updates usually don't include any [new features](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_newfeatures) as a new release would, but include product and documentation fixes and corrections. In addition, new major and minor versions are also available at no extra charge for the duration of your active support subscription. You can download updates by using the *Product Update* entry in the *SftTree/OCX 8.0* program group of the Start menu or from the *Product Updates* link on the About dialog. ### Before Contacting Product Support Your product purchase includes the first year's support subscription at no extra charge, which includes free product support. After the first year, the support subscription can be renewed for continued availability of product support, major versions and product maintenance. Comprehensive help files can assist you in [using SftTree/OCX](https://softelvdm.com/Documentation/SftTree%20OCX%208%200/Topic/g_using). If you have difficulties using SftTree/OCX, please use the following sources of information: - Obtain help using the documentation provided at [https://softelvdm.com/Documentation/SftTree OCX 8 0](https://softelvdm.com/Documentation/SftTree%20OCX%208%200). - Review support information or download product maintenance from our web site at [https://softelvdm.com/Product/Support/Name/SftTree OCX 8 0?ProductId=3131](https://softelvdm.com/Product/Support/Name/SftTree%20OCX%208%200?ProductId=3131). If this does not resolve your problem, please contact Softel vdm, Inc. Product Support. ### Contacting Product Support If you have reviewed the product documentation, please contact Softel vdm, Inc. Product Support. For current contact information please visit [https://softelvdm.com/support](https://softelvdm.com/support). **IMPORTANT: **Please include your license number in all cases. Without your license number, we will not be able to help you. Your license number is printed on your installation media (CD) or you may have received it as part of your online delivery.