Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example creates a date cell that displays a spin button and limits users to a minimum and maximum date.

C++

// Specify a cell
m_Spread.SetCol(2);
m_Spread.SetRow(3);
// Define cell type as date
m_Spread.SetCellType(CellTypeDate);
// Format cell to display month abbreviation, as in 01/JAN/90
m_Spread.SetTypeDateFormat(TypeDateFormatDDMONYY);
// Set minimum date
m_Spread.SetTypeDateMin("01011990");
// Set maximum date
m_Spread.SetTypeDateMax("01311990");
// Display spin button
m_Spread.SetTypeSpin(TRUE);
// 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
' Format cell to display month abbreviation, as in 01/JAN/90
fpSpread1.TypeDateFormat = TypeDateFormatDDMONYY
' Set minimum date
fpSpread1.TypeDateMin = "01011990"

' Set maximum date
fpSpread1.TypeDateMax = "01311990"
' Display spin button
fpSpread1.TypeSpin = True
' Set the column width
fpSpread1.ColWidth(2) = 10

Copyright © GrapeCity, inc. All rights reserved.