Spread 8.0 Documentation
TypeDateMax Property
Support Options
ActiveX Reference > ActiveX Properties > TypeDateMax Property

Glossary Item Box

TypeDateMax Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns the maximum date value allowed in a date cell. This property is available at run time only.

Syntax

C++

CString CSpreadSheet::GetTypeDateMax( );
void CSpreadSheet::SetTypeDateMax(LPCTSTR value);

Visual Basic

[form.]fpSpread.TypeDateMax[ = text$]

Remarks

The default value for the TypeDateMax property is "12312100". The maximum value you can provide for the TypeDateMax property is "12319999", or December 31, 9999.

Use the format "MMDDYYYY" to set the TypeDateMax property, where "MM" stands for two-digit month, "DD" stands for two-digit day, and "YYYY" stands for four-digit year.

The value you set for the TypeDateMax property is the maximum valid value for the cell or cells. When the user types or pastes a value larger than the maximum value into the cell, the cell changes the value to the closest valid date. For example, if the maximum valid date is "12311999" and the user types "12122001" the date is changed to "12121999".

Date values larger than the specified maximum value can still be added to the cell in code at run time or from a database; when they are added in code or from a database, the value is not changed to a valid value and the EditError event does not occur. However, the control changes those values to be less than the maximum value the next time the cell is in edit mode. If the cell leaves edit mode with no change to the value, though, the control changes the value back to the invalid value and the EditError event does not occur.

To use the TypeDateMax property, specify the sheet with which you want to work by setting the Sheet property. Then specify the cell or cells to which to apply the property, as described in Using Column and Row Properties. Once you set the TypeDateMax property for a cell or cells, any subsequent date cells you create will use the same TypeDateMax setting unless you reset it for those cells.

The TypeDateMax property does not have an effect unless the CellType property is set to 0 (Date) for the specified cell or cells.

Specify the minimum date value allowed in the cell by setting the TypeDateMin property. You can have the date cell display a spin button that lets users increment the date value to the minimum or maximum value allowed in the cell. To have the cell display a spin button, set the TypeSpin property for the cell to True.

Spread Designer

Choose the Cell menu, the Cell Type menu, the Date menu, and then the Settings tab, and then type a date in the Min Date edit box in the Cell Type Settings dialog box.

Data Type

String

See Also

Creating and Setting up a Date Cell

CellType, Sheet, TypeDateMin, TypeSpin properties

DLL Correspondence

SSSetTypeDate function

Copyright © GrapeCity, inc. All rights reserved.