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

Glossary Item Box

SSSetTypeCurrencyEx Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Sets the style, number of decimal places, minimum, maximum, format, and spin button characteristics for currency cells.

Syntax

C

LPSS_CELLTYPE SSSetTypeCurrencyEx(HWND hWnd, LPSS_CELLTYPE lpCellType, long lStyle, BYTE Right, double Min, double Max, BYTE fShowSeparator, BYTE fShowCurrencySymbol, LPTSTR lpszDecimal, LPTSTR lpszSeparator, LPTSTR lpszCurrency, BYTE bLeadingZero, BYTE bNegCurrencyStyle, BYTE bPosCurrencyStyle, BYTE fSpin, BYTE fSpinWrap, double SpinInc);

C++

LPSS_CELLTYPE TSpread::SetTypeCurrencyEx(LPSS_CELLTYPE lpCellType, long Style, BYTE Right, double Min, double Max, BYTE fShowSeparator, BYTE fShowCurrencySymbol, LPTSTR lpszDecimal, LPTSTR lpszSeparator, LPTSTR lpszCurrency, BYTE bLeadingZero, BYTE bNegCurrencyStyle, BYTE bPosCurrencyStyle, BYTE fSpin, BYTE fSpinWrap, double SpinInc);

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 Currency style
Use the (|) OR operator and combine the following values as indicated:
Constant Description
SSS_ELLIPSES Displays an ellipsis (...) when text is too long to fit in the cell
SSS_NEGRED Displays negative numbers as red
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
Right Number of digits to right of decimal place
Min Minimum valid currency value
The smallest value allowed is –99,999,999,999,999.
Max Maximum valid currency value
The largest value allowed is 99,999,999,999,999
fShowSeparator Set to TRUE to display the separator character
fShowCurrencySymbol Set to FALSE to not display currency symbol
lpszDecimal Decimal character
lpszSeparator Separator character used to separate groups of thousands digits (for example, the comma in "$1,000")
lpszCurrency Currency symbol
bLeadingZero Specifies whether a leading zero displays in a currency cell
Can be one of the following values:
Constant Description
SS_LEADINGZERO_INTL Uses the regional setting for Number Format in the Windows Control Panel
SS_LEADINGZERO_NO Removes the leading zero
SS_LEADINGZERO_YES Displays the leading zero
bNegCurrencyStyle Format for negative currency values
Can be one of the following values:
Constant Description
SS_CURR_NEGSTYLE_INTL Uses the regional Currency Format setting in the Windows Control Panel
SS_CURR_NEGSTYLE_1 ($1.1)
SS_CURR_NEGSTYLE_2 –$1.1
SS_CURR_NEGSTYLE_3 $–1.1
SS_CURR_NEGSTYLE_4 $1.1–
SS_CURR_NEGSTYLE_5 (1.1$)
SS_CURR_NEGSTYLE_6 –1.1$
SS_CURR_NEGSTYLE_7 1.1-$
SS_CURR_NEGSTYLE_8 1.1$–
SS_CURR_NEGSTYLE_9 –1.1 $
SS_CURR_NEGSTYLE_10 –$ 1.1
SS_CURR_NEGSTYLE_11 1.1 $–
SS_CURR_NEGSTYLE_12 $ 1.1–
SS_CURR_NEGSTYLE_13 $ –1.1
SS_CURR_NEGSTYLE_14 1.1– $
SS_CURR_NEGSTYLE_15 ($ 1.1)
SS_CURR_NEGSTYLE_16 (1.1 $)
bPosCurrencyStyle Fomat for positive currency values
Can be one of the following values:
Constant Description
SS_CURR_POSSTYLE_INTL Uses the regional Currency Format setting in the Windows Control Panel
SS_CURR_POSSTYLE_1 $1.1
SS_CURR_POSSTYLE_2 1.1$
SS_CURR_POSSTYLE_3 $ 1.1
SS_CURR_POSSTYLE_4 1.1 $
fSpin Displays spin button in cell
(The spin button is displayed only if edit mode is on.)
fSpinWrap Set to TRUE to wrap the value of the spin button when the maximum or minimum values are reached
SpinInc Amount spin button increments currency value

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 sets a currency cell type that lets you customize the currency format and allows a spin button to be placed within the currency cell. Use this function if you want to customize the currency format and display a spin button in a currency cell; otherwise, use the SSSetTypeCurrency 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.

To determine the decimal, separator, and currency character used in the Spread control, the control looks at the values specified in the lpszDecimal, lpszSeparator, and lpszCurrency parameters. If no value is specified, the control uses the regional Currency Decimal Symbol, Digital Grouping, and Currency Symbol settings in the Windows Control Panel.

Notes:
  • Do not use a plus sign ("+"), a minus sign ("–"), or a space (" ") as a decimal character.
  • The control does not recognize changes made to the regional Windows settings until you restart your development environment or your application (or perform any operation that unloads and reloads the current control files). For more information about regional settings and Windows operating environments, see Variations in Windows Regional Settings or Options.

The value specified for the Max parameter is the maximum value the control allows the user to type or paste into the cell. If the user tries to type or paste a value greater than the value specified, the control beeps (unless you have called the SSSetBool function and set the SSB_NOBEEP boolean to TRUE) and the user is not allowed to type the value.

Values larger than the specified maximum value can still be added to the cell in code at run time; when they are added in code, the value is allowed in the cell. However, the control adjusts those values to be zero 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.

The value specified for the Min parameter is the minimum valid value for the cell. When the user types or pastes a value smaller than the minimum value into the cell, the control sends the SSN_INVALIDDATA message when the cell leaves edit mode, but the user's value is allowed in the cell. Values smaller than the specified minimum value can also be added to the cell in code at run time; when they are added in code, the value is allowed in the cell and the control does not send the SSN_INVALIDDATA message.

Return Value

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

See Also

Variations in Windows Regional Settings or Options
Formatting a Currency Cell
Displaying a Spin Button in a Currency Cell

SSSetBool, SSSetCellType, SSSetCellTypeRange, SSSetSheet, SSSetTypeCurrency functions

SSN_INVALIDDATA message

SS_CELLTYPE structure

ActiveX Correspondence

TypeCurrencyDecimal, TypeCurrencyDecPlaces, TypeCurrencyLeadingZero, TypeCurrencyMax, TypeCurrencyMin, TypeCurrencyNegStyle, TypeCurrencyPosStyle, TypeCurrencySeparator, TypeCurrencyShowSep, TypeCurrencyShowSymbol, TypeCurrencySymbol properties

Copyright © GrapeCity, inc. All rights reserved.