HeaderPane
Main
Hide
Share Link
Print

TreeLineStyle

Defines the display style of tree lines.

C

int WINAPI SftBox_GetTreeLineStyle(HWND hwndCtl);
void WINAPI SftBox_SetTreeLineStyle(HWND hwndCtl, int style);

C++

int CSftBox::GetTreeLineStyle() const;
void CSftBox::SetTreeLineStyle(int style);

Parameters

hwndCtl

The window handle of the combo box control.

style

Defines the display style used for tree lines. style can be one of the following values:

SFTBOX_TREELINE_NONENo tree lines.
SFTBOX_TREELINE_SOLIDTree lines are drawn using a solid line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other.
SFTBOX_TREELINE_DOTTree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other.
SFTBOX_TREELINE_DOT0Tree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are also connected to each other.
SFTBOX_TREELINE_TRANSPARENTConnecting tree lines are not shown, but all layout and formatting is calculated as if they were present. This only affects the horizontal indentation of levels.
SFTBOX_TREELINE_AUTOMATICConnecting tree lines are not shown. Same as SFTBOX_TREELINE_TRANSPARENT.
SFTBOX_TREELINE_AUTOMATIC0Connecting tree lines are not shown. Same as SFTBOX_TREELINE_TRANSPARENT.

Returns

GetTreeLineStyle returns a value indicating the current display style used for tree lines in the dropdown portion. SFTBOX_TREELINE_TRANSPARENT is returned if SFTBOX_TREELINE_AUTOMATIC or SFTBOX_TREELINE_AUTOMATIC0 was set.

Comments

The GetTreeLineStyle and SetTreeLineStyle functions define the display style of tree lines.

The tree line style always applies to the dropdown portion. It is applied to the static portion only while the fStaticAligned member of the SFTBOX_CONTROL structure is TRUE (see SetControlInfo), otherwise the static portion shows no tree lines.

When a combo box control is created, tree lines are not shown (SFTBOX_TREELINE_NONE).

The color used for tree lines can be defined using SFTBOX_COLORS, colorTreeLines.

Examples

C View entire sample code

    Sft_InitPicture(&aThreeItemPictures[0]);
    Sft_InitPicture(&aThreeItemPictures[1]);
    Sft_InitPicture(&aThreeItemPictures[2]);
    Sft_SetPictureIcon(&aThreeItemPictures[0], m_ahIcons[ICON_FOLDER]);    /* Expandable picture */
    Sft_SetPictureIcon(&aThreeItemPictures[1], m_ahIcons[ICON_FOLDEROPEN]);/* Expanded picture */
    Sft_SetPictureIcon(&aThreeItemPictures[2], m_ahIcons[ICON_DOCUMENT]);  /* Leaf picture */
    SftBox_SetPictures(hwndBox, aThreeItemPictures);

    SftBox_SetTreeLineStyle(hwndBox, SFTBOX_TREELINE_AUTOMATIC);// Dotted or invisible tree lines, following the Windows theme
    SftBox_SetShowButtons(hwndBox, TRUE);       // Expand/collapse buttons (level 1..n)
    SftBox_SetShowButton0(hwndBox, TRUE);       // Expand/collapse buttons (level 0)
    SftBox_SetButtons(hwndBox, SFTBOX_BUTTON_AUTOMATIC);// Button style follows the Windows theme
    SftBox_SetDroppedHeight(hwndBox, 12);       // Show up to 12 items
    SftBox_SetDarkMode(hwndBox, SFTBOX_DARKMODE_AUTO);

    // The level of an item defines the hierarchy: an item is a

C++ View entire sample code

    Sft_InitPicture(&aThreeItemPictures[0]);
    Sft_InitPicture(&aThreeItemPictures[1]);
    Sft_InitPicture(&aThreeItemPictures[2]);
    Sft_SetPictureIcon(&aThreeItemPictures[0], m_ahIcons[ICON_FOLDER]);    /* Expandable picture */
    Sft_SetPictureIcon(&aThreeItemPictures[1], m_ahIcons[ICON_FOLDEROPEN]);/* Expanded picture */
    Sft_SetPictureIcon(&aThreeItemPictures[2], m_ahIcons[ICON_DOCUMENT]);  /* Leaf picture */
    m_Folders.SetPictures(aThreeItemPictures);

    m_Folders.SetTreeLineStyle(SFTBOX_TREELINE_AUTOMATIC);// Dotted or invisible tree lines, following the Windows theme
    m_Folders.SetShowButtons(TRUE);     // Expand/collapse buttons (level 1..n)
    m_Folders.SetShowButton0(TRUE);     // Expand/collapse buttons (level 0)
    m_Folders.SetButtons(SFTBOX_BUTTON_AUTOMATIC);// Button style follows the Windows theme
    m_Folders.SetDroppedHeight(12);     // Show up to 12 items
    m_Folders.SetDarkMode(SFTBOX_DARKMODE_AUTO);

    // The level of an item defines the hierarchy: an item is a

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.