Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

Creating a Dialog Resource

This section describes how to add a tree control to a dialog using Visual Studio.

Adding a Tree Control to a Dialog

To add a SftTree/DLL control to a dialog, use the "Custom Control" toolbar button. Click on the button and then the dialog being designed to add a control.

Custom Control

Once a custom control has been added to a dialog, you can edit the control properties by using the View, Properties... menu command.

Properties

To define a SftTree/DLL control, enter the class SftTreeControl75 or SftTreeSplit75 in the edit field labeled Class. A window caption is not necessary, so the edit field marked Caption can be left blank.

Window Class Name
Tree ControlSftTreeControl75
Split Tree ControlSftTreeSplit75

SftTree/DLL Control Styles

To enter a SftTree/DLL window style in the User Control Properties dialog, use the following list to add the desired style values and enter the resulting hexadecimal value in the field marked Style. For detailed information, see "Window Styles".

The SftTree/DLL Wizard displays the style value as part of the generated source code so it can be copied.

StyleValueDescription
SFTTREESTYLE_DISABLENOSCROLL0x00000001Prevents the scroll bars from being hidden when scrolling is not possible. The scroll bars are disabled when scrolling is not possible.
SFTTREESTYLE_DRAGDROP0x00000010Enables drag & drop processing for the tree control. WM_COMMAND messages are then sent to the tree control's parent window for drag & drop processing.
SFTTREESTYLE_LEFTBUTTONONLY0x00000020When this style is selected, the tree control will ignore the middle and right mouse buttons. No notifications will be sent to the parent window when the middle or right mouse buttons are clicked. WM_CONTEXTMENU messages are generated instead.
SFTTREESTYLE_MULTIPLESEL0x00000008Enables multiple tree items to be selected at the same time. The mouse, the Shift and Control keys can be used to select multiple items.
SFTTREESTYLE_NOTIFY0x00000004The SftTree/DLL control will send WM_COMMAND messages to the parent window for special event notification.
SFTTREESTYLE_SCROLL0x00000040When this style is selected, the window styles WS_HSCROLL and WS_VSCROLL given when the tree control is created determine whether scroll bars are present. If this style is not selected, scroll bars are automatically added to the tree control when needed. E.g., to prevent a vertical scroll bar from being added to the tree control, define the SFTTREESTYLE_SCROLL style and do not add the WS_VSCROLL style.
SFTTREESTYLE_VARIABLE0x00000080Defines a variable height tree control, where the height of each item varies based on the fonts, pictures, lines of text, word wrapping and other attributes used.
SFTTREESTYLE_WANTKEYBOARDINPUT0x00000002The SftTree/DLL control will send WM_VKEYTOITEM messages to the parent window for keyboard input processing.
WS_BORDER0x00800000Draws a border around the control. The border is a dark line.
WS_HSCROLL0x00100000Adds a horizontal scroll bar to the tree control.
WS_VSCROLL0x00200000Adds a vertical scroll bar to the tree control.

Test Mode

In the dialog test mode offered by Visual Studio, the SftTree/DLL control will not be displayed. Instead, a gray box will show the location of the control. When using the Tab key to test the tab stops, the simulated SftTree/DLL control will not receive the input focus and appear not to have a tab stop defined.