Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a time cell that displays seconds, displays time in a 24-hour format, and uses a customized separator character.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(2);

// Define cell type as time
m_Spread.SetCellType(CellTypeTime);
// Set 24-hour time format
m_Spread.SetTypeTime24Hour(TypeTime24Hour24HourClock);
// Display seconds
m_Spread.SetTypeTimeSeconds(TRUE);
// Define the separator character
m_Spread.SetTypeTimeSeparator("46");
// Specify time value for cell
m_Spread.SetValue("145236");

Visual Basic

' Specify a cell
fpSpread1.Col = 2
fpSpread1.Row = 2

' Define cell type as time
fpSpread1.CellType = CellTypeTime
' Set 24-hour time format
fpSpread1.TypeTime24Hour = TypeTime24Hour24HourClock
' Display seconds
fpSpread1.TypeTimeSeconds = True
' Define the separator character
fpSpread1.TypeTimeSeparator = Asc(".")
' Specify time value for cell
fpSpread1.Value = "145236"

Copyright © GrapeCity, inc. All rights reserved.