Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a date cell that displays the century, uses a custom separator, and centers the date in the cell.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(3);
// Define cell type as date
m_Spread.SetCellType(CellTypeDate);
// Set the cell to display the century digits
m_Spread.SetTypeDateCentury(TRUE);
// Center the date
m_Spread.SetTypeHAlign(TypeHAlignCenter);
// Display a hyphen as the separator character
m_Spread.SetTypeDateSeparator('-');
// Set the column width
m_Spread.SetColWidth(2,10);

Visual Basic

' Specify a cell
fpSpread1.Col = 2
fpSpread1.Row = 3
' Define cell type as date
fpSpread1.CellType = CellTypeDate
' Set the cell to display the century digits
fpSpread1.TypeDateCentury = True
' Center the date
fpSpread1.TypeHAlign = TypeHAlignCenter
' Display a hyphen as the separator character
fpSpread1.TypeDateSeparator = ASC("-")
' Set the column width
fpSpread1.ColWidth(2) = 10

Copyright © GrapeCity, inc. All rights reserved.