TypePicMask Property
Applies To
fpSpread control
Description
Sets or returns the mask used in a PIC cell. This property is available at run time only.
Syntax
CString CSpreadSheet::GetTypePicMask( );
void CSpreadSheet::SetTypePicMask(LPCTSTR value);
[form.]fpSpread.TypePicMask[ = text$]
Remarks
Each character in the mask represents one displayed character, with the exception of placeholders.
Use the following characters to specify what type of data the user can type into the mask:
Mask Character | Characters Allowed |
---|---|
X | Any ASCII character |
9 | 0–9, decimal |
A | A–Z, a–z plus any alphabetic character from larger character sets such as ANSI or Unicode |
N | A–Z, a–z, 0–9, decimal |
U | A–Z |
L | a–z |
H | (Hexadecimal) 0–9, a–f, A–F |
The defined PIC cell allows users to type or paste, and accepts from code or a database, valid characters into the mask, up to the number of characters defined in the mask. The cell does not allow the user to type or paste invalid characters in the cell, nor does it allow invalid values from code or a database.
You can add placeholder characters by just typing them in the mask definition. To specify one of the above mask characters as a placeholder, type a slash character (/) and then the character. When the user types data into the cell, placeholder characters are automatically skipped. No entry is permitted in these positions, nor is the user able to delete them.
The cell can also display default text that is displayed in the cell when it is in edit mode. Specify the default text using the TypePicDefaultText property.
To use the TypePicMask 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 TypePicMask property for a cell or cells, any subsequent PIC cells you create will use the same TypePicMask setting unless you reset it for those cells.
The TypePicMask property does not have an effect unless the CellType property is set to 4 (PIC) for the specified cell or cells.
Spread Designer
Choose the Cell menu, the Cell Type menu, the Mask(Pic) menu, and then the Settings tab, and then type a mask in the Mask Definition edit box in the Cell Type Settings dialog box.
Data Type
String
See Also
CellType, Sheet, TypePicDefaultText properties