Spread 8.0 Documentation
SSSetTypeEdit Function
Support Options
DLL Reference > DLL Functions > SSSetTypeEdit Function

Glossary Item Box

SSSetTypeEdit Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Sets the style, length, characters, and cases allowed for edit cells.

Syntax

C

LPSS_CELLTYPE SSSetTypeEdit(HWND hWnd, LPSS_CELLTYPE lpCellType, long Style, int Len, short ChrSet, short ChrCase);

C++

LPSS_CELLTYPE TSpread::SetTypeEdit(LPSS_CELLTYPE lpCellType, long Style, short Len, short ChrSet, short ChrCase);

Parameters

The following parameters are available:

Parameter Description
hWnd Window handle of the fpSpread control
lpCellType Pointer to structure to contain cell type information
Style Edit style
Use the (|) OR operator and combine the following values as indicated:
Constant Description
ES_AUTOHSCROLL Allows horizontal scrolling in cell
Use one of the following values:
ES_MULTILINE Allows multiple-line editing in cell
SSS_ELLIPSES Displays an ellipsis (...) when text is too long to fit in the cell
ES_WANTRETURN Allows the user to press the Enter key to add a new line to a multiline cell
(This value can only be used in conjunction with the ES_MULTILINE value. If ES_MULTILINE is included and ES_WANTRETURN is omitted, pressing the Enter key in a multiline cell exits edit mode.)
Use one of the following values:
SSS_ALIGN_TOP (Default) Aligns text at the top of cells
SSS_ALIGN_BOTTOM Aligns text at the bottom of cells
SSS_ALIGN_VCENTER Centers text vertically within the cell
Use one of the following values:
SSS_ALIGN_LEFT (Default) Aligns text to the left in the cell
SSS_ALIGN_RIGHT Aligns text to the right in the cell
SSS_ALIGN_CENTER Centers text horizontally within the cell
Use one of the following values:
SSS_TEXTORIENT_VERT_LTR Displays text vertically in the cell and wraps from left to right
SSS_TEXTORIENT_DOWN Rotates text 90 degrees (to "3 o'clock")
SSS_TEXTORIENT_UP Rotates text 270 degrees (to "9 o'clock")
SSS_TEXTORIENT_INVERT Rotates text 180 degrees (to "6 o'clock")
SSS_TEXTORIENT_VERT_RTL Displays text vertically in the cell and wraps from right to left
Len Maximum number of characters the user can type in the edit cell
ChrSet Type of characters to use
Use one of the following values:
Constant Description
SS_CHRSET_CHR All characters
SS_CHRSET_ALPHA Alphabetic characters only
SS_CHRSET_ALPHANUM Alphanumeric characters only
SS_CHRSET_NUM Numbers only
ChrCase Specifies case of displayed characters
Use one of the following values:
Constant Description
SS_CASE_LCASE Lowercase letters only
SS_CASE_NOCASE Case displays as typed
SS_CASE_UCASE Uppercase letters only

Remarks

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.

This function initializes a structure of the specified type (SS_CELLTYPE). You can use this structure to set an individual cell or block of cells using the SSSetCellType or SSSetCellTypeRange functions.

A beep sounds to notify the user when the maximum number of characters specified by the Len parameter is reached (unless you have called the SSSetBool function and set the SSB_NOBEEP boolean to TRUE), and the control prevents the user from typing more characters. If the user tries to paste in a value with more characters than the allowed amount, or such a value is provided through code, the value is truncated to the number of allowed characters.

The ChrSet parameter restricts both what users can type or paste into the specified edit cell and what can be entered from code. Only valid characters are allowed in from any source. However, if the setting of the ChrSet parameter changes for a cell, existing text in the cell is not changed to meet the requirements of the new setting. For example, if the cell contains the value "ABCD", and the parameter setting changes to SS_CHRSET_NUM, the text in the cell does not change.

The ChrCase parameter affects all text provided to the cell, including text the user types or pastes into the cell, as well as text provided from code. However, if the setting of the ChrCase parameter changes, the control does not change text already in the cell. The change only affects text provided to the cell after the setting is changed.

Return Value

Pointer to the SS_CELLTYPE structure, or NULL if any of the parameters are invalid.

See Also

Creating Edit Cells

SSSetBool, SSSetCellType, SSSetCellTypeRange, SSSetSheet functions

ActiveX Correspondence

TypeEditCharCase, TypeEditCharSet, TypeEditMultiLine, TypeEditPassword, TypeMaxEditLen properties

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.