Spread 8.0 Documentation
SSGetColor, SSSetColor, SSSetColorRange Functions
Support Options
DLL Reference > DLL Functions > SSGetColor, SSSetColor, SSSetColorRange Functions

Glossary Item Box

SSGetColor, SSSetColor, SSSetColorRange Functions


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Set or return the foreground and background colors of a cell, a column, a row, or the entire sheet, or set those colors for a block of cells.

Syntax

C

BOOL SSGetColor(HWND hWnd, SS_COORD Col, SS_COORD Row, LPCOLORREF lpBackground, LPCOLORREF lpForeground);

BOOL SSSetColor(HWND hWnd, SS_COORD Col, SS_COORD Row, COLORREF Background, COLORREF Foreground);

BOOL SSSetColorRange(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, COLORREF Background, COLORREF Foreground);

C++

BOOL TSpread::GetColor(SS_COORD Col, SS_COORD Row, LPCOLORREF lpBackground, LPCOLORREF lpForeground);

BOOL TSpread::SetColor(SS_COORD Col, SS_COORD Row, COLORREF Background, COLORREF Foreground);

BOOL TSpread::SetColorRange(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, COLORREF Background, COLORREF Foreground);

Parameters

The SSGetColor function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of cell
Row Row number of cell
lpBackground Pointer to variable that receives cell background color
lpForeground Pointer to variable that receives cell foreground color

The SSSetColor and SSSetColorRange functions have the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of cell or column number of upper-left cell of the block if specifying a block for the SSSetColorRange function
Row Row number of cell or row number of upper-left cell of the block if specifying a block for the SSSetColorRange function
Col2 Column number of lower-right cell of the block if specifying a block for the SSSetColorRange function
Row2 Row number of lower-left cell of the block if specifying a block for the SSSetColorRange function
Background Cell background color
(Value can be SPREAD_COLOR_NONE, which specifies to use the column, row, or sheet background color.)
Foreground Cell foreground color
(Value can be SPREAD_COLOR_NONE, which specifies to use the column, row, or sheet foreground color.)

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. To determine the settings you want for the Col, Row, Col2, and Row2 parameters, see Using Column and Row Properties.

Remarks

Use the SSSetColorRange function to specify the color for a block of cells.

If any of the static text cells use the SSSetTypeStaticText function SS_TEXT_SHADOW style, which is the default for the headers, the color is determined by the SSSetShadowColor function, not the SSSetColor function.

When cells are marked as locked with the SSSetLock function and the SSSetBool function SSB_PROTECT boolean is set to TRUE, the value of the SSSetLockColor function overrides the value of the SSSetColor or SSSetColorRange function.

Notes:
  • You cannot change the background color of the drop-down list portion of a combo box cell. The background color of the drop-down list portion of a combo box cell is always white.
  • By default, the background color of a cell overlaps the right and bottom sides of the cell's grid lines. Call the SSSetBackColorStyle function to specify whether the right grid line, the bottom grid line, or both overlap the background color.
  • To change the background color of a button cell, you must use the SSSetTypeButton lpColor parameter.

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

Setting Cell Background and Text Colors

SSSetBool, SSSetLock, SSSetLockColor, SSSetShadowColor, SSSetSheet, SSSetTypeStaticText functions

ActiveX Correspondence

BackColor, ForeColor properties

Copyright © GrapeCity, inc. All rights reserved.