TypeDateMin Property
Applies To
fpSpread control
Description
Sets or returns the minimum date value for a date cell. This property is available at run time only.
Syntax
CString CSpreadSheet::GetTypeDateMin( );
void CSpreadSheet::SetTypeDateMin(LPCTSTR value);
[form.]fpSpread.TypeDateMin[ = text$]
Remarks
The default value for the TypeDateMin property is "01011990". The minimum value you can provide for the TypeDateMin property is "01011000", or January 1, 1000 A.D.
Use the format "MMDDYYYY" to set the TypeDateMin 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 TypeDateMin property is the minimum valid value for the cell or cells. When the user types or pastes a value smaller than the minimum value into the cell, the cell changes the value to the closest valid date. For example, if the minimum valid date is "01011998" and the user types "12121997" the date is changed to "12121998".
Date values smaller than the specified minimum value can 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 greater than the minimum 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 TypeDateMin 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 TypeDateMin property for a cell or cells, any subsequent date cells you create will use the same TypeDateMin setting unless you reset it for those cells.
The TypeDateMin property does not have an effect unless the CellType property is set to 0 (Date) for the specified cell or cells.
Specify the maximum date value allowed in the cell by setting the TypeDateMax 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, TypeDateMax, TypeSpin properties
EditError event
DLL Correspondence
SSSetTypeDate function