2.2.4.5.43 Column::SetCustomDisplay

Description

To set the custom date display format. This action is same as setup Custom Date Formats in Preference: Options : Miscellaneous.

Syntax

BOOL SetCustomDisplay( LPCSTR lpcszDisplay, bool bUndo = false )

Parameters

lpcszDisplay
[input] The custom date display string.
bUndo
[input] true to support undo mechanism.

Return

TRUE if succesfull, otherwise FALSE.

Examples

EX1

void    Column_SetCustomDisplay_Ex1()
{
    Worksheet wks = Project.ActiveLayer();
    if(!wks)
        return;
    
    Column col(wks, 0);
    if( col )
    {
        col.SetFormat(OKCOLTYPE_DATE);
        col.SetSubFormat(LDF_OBJ_CUSTOM);
        if( col.SetCustomDisplay("dd-MM-yy") )
            printf("The custom display format of Column %u is %s\n", col.GetIndex()+1, col.GetCustomDisplay());
        else
            printf("Fail to set custom format to this column\n");
    }
}

Remark

See Also

Column::GetCustomDisplay
Column::SetFormat
Column::SetSubFormat

Header to Include

origin.h