2.2.4.22.38 Grid::ShowHeaders

Description

show/hide column or row header

Syntax

BOOL ShowHeaders( BOOL bShow, BOOL bUndo = FALSE, BOOL bColHeaders = true )

Parameters

bShow
[input] to show or hide
bUndo
[input] support undo mechanism
bColHeaders
[input] for column header or row header

Return

TRUE if success else FALSE.

Examples

EX1

//before execute the function, there must exist a workbook
void Grid_ShowHeaders_ex1()
{
	Worksheet wks = Project.ActiveLayer();
    if(wks)
    {
        Grid gg;
        gg.Attach(wks, 1);
 
        bool    bColHeaders = true;
        gg.ShowHeaders(!gg.IsHeadersShown(bColHeaders), false, bColHeaders);
 
        bColHeaders = false;//row header
        gg.ShowHeaders(!gg.IsHeadersShown(bColHeaders), false, bColHeaders);
    }
}

EX2

void Grid_ShowHeaders_ex2()
{
    Worksheet wks = Project.ActiveLayer();
    if(wks && wks.GetSystemParam(0) & WP_SHEET_HIERARCHY)
    {
        Grid gg;
        gg.Attach(wks, 1);
        
        bool    bColHeaders = true;
        gg.ShowHeaders(!gg.IsHeadersShown(bColHeaders), false, bColHeaders);
        
        bColHeaders = false;//row header
        gg.ShowHeaders(!gg.IsHeadersShown(bColHeaders), false, bColHeaders);
    }
}

Remark

See Also

Grid::IsHeadersShown

Header to Include

origin.h