Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a time cell with a spin button, minimum and maximum time values, and center-aligned text within the cell. In the following illustration the text is not centered because the cell is in edit mode.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(2);
// Specify the column width
m_Spread.SetColWidth(2,10);

// Define cell type as time
m_Spread.SetCellType(CellTypeTime);
// Specify the minimum time value
m_Spread.SetTypeTimeMin("080000");
// Specify the maximum time value
m_Spread.SetTypeTimeMax("170000");
// Specify a time value
m_Spread.SetValue("080000");

// Center the time
m_Spread.SetTypeHAlign(TypeHAlignCenter);
// Specify a spin button
m_Spread.SetTypeSpin(TRUE);

Visual Basic

' Specify a cell
fpSpread1.Col = 2
fpSpread1.Row = 2
' Specify the column width
fpSpread1.ColWidth(2) = 10

' Define cell type as time
fpSpread1.CellType = CellTypeTime
' Specify the minimum time value
fpSpread1.TypeTimeMin = "080000"
' Specify the maximum time value
fpSpread1.TypeTimeMax = "170000"
' Specify a time value
fpSpread1.Value = "080000"

' Center the time
fpSpread1.TypeHAlign = TypeHAlignCenter
' Specify a spin button
fpSpread1.TypeSpin = True

Copyright © GrapeCity, inc. All rights reserved.