Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ShowButton0

Defines the presence of level 0 expand/collapse buttons.

C

BOOL WINAPI SftTree_GetShowButton0(HWND hwndCtl);
void WINAPI SftTree_SetShowButton0(HWND hwndCtl, BOOL fSet);
BOOL WINAPI SftTreeSplit_GetShowButton0(HWND hwndCtl);
void WINAPI SftTreeSplit_SetShowButton0(HWND hwndCtl, BOOL fSet);

C++

BOOL CSftTree::GetShowButton0() const;
void CSftTree::SetShowButton0(BOOL fSet = TRUE);
BOOL CSftTreeSplit::GetShowButton0() const;
void CSftTreeSplit::SetShowButton0(BOOL fSet = TRUE);

Parameters

hwndCtl

The window handle of the tree control.

fSet

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

Returns

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

Comments

The GetShowButton0 and SetShowButton0 functions define the presence of level 0 expand/collapse buttons.

SetShowButtons can be used to enable or disable expand/collapse buttons on levels other than level 0.

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

Examples

C

            // /* 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 */
        SftTree_SetShowTruncated(g_hwndTree, TRUE);/* Show ... if truncated */

C++

        // 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 */
    m_Tree.SetShowTruncated(TRUE);       /* Show ... if truncated */

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