Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ShowButtons

Defines the presence of expand/collapse buttons (other than level 0).

C

BOOL WINAPI SftTree_GetShowButtons(HWND hwndCtl);
void WINAPI SftTree_SetShowButtons(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetShowButtons(HWND hwndCtl);
void WINAPI SftTreeSplit_SetShowButtons(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetShowButtons() const;
void CSftTree::SetShowButtons(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetShowButtons() const;
void CSftTreeSplit::SetShowButtons(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

Set to TRUE to display expand/collapse buttons for all items (except items on level 0), otherwise set to FALSE.

Returns

GetShowButtons returns a value indicating whether expand/collapse buttons for items on all levels except level 0 are shown. TRUE is returned if expand/collapse buttons are shown, otherwise FALSE is returned.

Comments

The GetShowButtons and SetShowButtons functions define the presence of expand/collapse buttons (other than level 0).

SetShowButton0 can be used to enable or disable expand/collapse buttons on level 0.

The SetItemExpandCollapseButton function can be used to hide an item's expand/collapse button.

Examples

C

            // SftTree_GetCellInfo(g_hwndTree, &CellInfo);
            // /* m_hCellBitmap = LoadBitmap(app_instance, MAKEINTRESOURCE(IDB_your_bitmap)); *//* Cell bitmap */
            // Sft_SetPictureBitmap(&CellInfo.Cell.CellPicture1, m_hCellBitmap);
            // CellInfo.Cell.flag = SFTTREE_BMP_RIGHT;
            // SftTree_SetCellInfo(g_hwndTree, &CellInfo);
        }

        SftTree_SetTreeLineStyle(g_hwndTree, SFTTREE_TREELINE_AUTOMATIC0);/* Dotted tree lines (incl. level 0) */
        SftTree_SetShowButtons(g_hwndTree, TRUE);/* Expand/collapse buttons (level 1..n) */
        SftTree_SetShowButton0(g_hwndTree, TRUE);/* Show expand/collapse buttons (level 0) */
        if (SftTree_GetGDIPlusAvailable(g_hwndTree))
            SftTree_SetButtons(g_hwndTree, SFTTREE_BUTTON_USERDEF);/* User-defined buttons */
        else
            SftTree_SetButtons(g_hwndTree, SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
        SftTree_SetShowGrid(g_hwndTree, TRUE);/* Show grid */
        SftTree_SetGridStyle(g_hwndTree, SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */

C++

        // CellInfo.iCol = column_number_to_change;
        // m_Tree.GetCellInfo(&CellInfo);
        // /* m_CellBitmap.LoadBitmap(IDB_your_bitmap); *//* Cell picture */
        // Sft_SetPictureBitmap(&CellInfo.Cell.CellPicture1, m_CellBitmap);
        // CellInfo.Cell.flag = SFTTREE_BMP_RIGHT;
        // m_Tree.SetCellInfo(&CellInfo);
    }
    m_Tree.SetTreeLineStyle(SFTTREE_TREELINE_AUTOMATIC0);/* Dotted tree lines (incl. level 0) */
    m_Tree.SetShowButtons(TRUE);         /* Expand/collapse buttons (level 1..n) */
    m_Tree.SetShowButton0(TRUE);         /* Show expand/collapse buttons (level 0) */
    if (m_Tree.GetGDIPlusAvailable())
        m_Tree.SetButtons(SFTTREE_BUTTON_USERDEF);/* User-defined buttons */
    else
        m_Tree.SetButtons(SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
    m_Tree.SetShowGrid(TRUE);            /* Show grid */
    m_Tree.SetGridStyle(SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */

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