Spread 8.0 Documentation
SSGetBorder, SSSetBorder, SSSetBorderRange Functions
Support Options
DLL Reference > DLL Functions > SSGetBorder, SSSetBorder, SSSetBorderRange Functions

Glossary Item Box

SSGetBorder, SSSetBorder, SSSetBorderRange Functions


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Set or return the position of the border, the type of border, and the color of the border for a specified cell, or sets those characteristics for a block of cells.

Syntax

C

BOOL SSGetBorder(HWND hWnd, SS_COORD Col, SS_COORD Row, LPWORD lpwBorderType, LPWORD lpwBorderStyle, LPCOLORREF lpColor);

BOOL SSSetBorder(HWND hWnd, SS_COORD Col, SS_COORD Row, WORD wBorderType, WORD wBorderStyle, COLORREF Color);

BOOL SSSetBorderRange(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, WORD wBorderType, WORD wBorderStyle, COLORREF Color);

C++

BOOL TSpread::GetBorder(SS_COORD Col, SS_COORD Row, LPWORD lpwBorderType, LPWORD lpwBorderStyle, LPCOLORREF lpColor);

BOOL TSpread::SetBorder(SS_COORD Col, SS_COORD Row, WORD wBorderType, WORD wBorderStyle, COLORREF Color);

BOOL TSpread::SetBorderRange(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, WORD wBorderType, WORD wBorderStyle, COLORREF Color);

Parameters

The SSGetBorder function has the following parameters:

Parameter Description
hWnd Window handle of the fpSpread control
Col Column number of cell with border
Row Row number of cell with border
lpwBorderType Pointer to variable that receives border type for specified cell
Combine any of the following values with the (|) OR operator:
Constant Description
SS_BORDERTYPE_NONE No border
(Displays the default grid.)
SS_BORDERTYPE_LEFT Border on left side of cell
SS_BORDERTYPE_RIGHT Border on right side of cell
SS_BORDERTYPE_TOP Border at top of cell
SS_BORDERTYPE_BOTTOM Border at bottom of cell
lpwBorderStyle Pointer to variable that receives border style for specified cell
Can be any combination of the following values:
Constant Description
SS_BORDERSTYLE_NONE No border
(Displays the default grid.)
SS_BORDERSTYLE_SOLID Solid border
SS_BORDERSTYLE_DASH Dash border
SS_BORDERSTYLE_DOT Dot border
SS_BORDERSTYLE_DASHDOT Dash dot border
SS_BORDERSTYLE_DASHDOTDOT Dash dot dot border
SS_BORDERSTYLE_BLANK Erases border and grid
SS_BORDERSTYLE_FINE_SOLID Thin solid border
SS_BORDERSTYLE_FINE_DASH Thin dash border
SS_BORDERSTYLE_FINE_DOT Thin dot border
SS_BORDERSTYLE_FINE_DASH_DOT Thin dash dot border
SS_BORDERSTYLE_FINE_DASH_DOT_DOT Thin dash dot dot border
lpColor Pointer to variable that receives border color for specified cell

The SSSetBorder and SSSetBorderRange 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 SSSetBorderRange function
Row Row number of cell or row number of upper-left cell of the block if specifying a block for the SSSetBorderRange function
Col2 Column number of lower-right cell of the block if specifying a block for the SSSetBorderRange function
Row2 Row number of lower-right cell of the block if specifying a block for the SSSetBorderRange function
wBorderType Border type to be used around specified cell
Use one of the first values in the following list, or combine any or all of the last four values:
Constant Description
SS_BORDERTYPE_NONE No border
(Displays the default grid.)
SS_BORDERTYPE_OUTLINE Displays border around cell or block of cells
Combine any of the following values with the (|) OR operator:
SS_BORDERTYPE_LEFT Displays border on left side of cell or block of cells
SS_BORDERTYPE_RIGHT Displays border on right side of cell or block of cells
SS_BORDERTYPE_TOP Displays border on top of cell or block of cells
SS_BORDERTYPE_BOTTOM Displays border at bottom of cell or block of cells
wBorderStyle Border style for specified cell
Use one of the following values:
Constant Description
SS_BORDERSTYLE_NONE No border
(Displays the default grid.)
SS_BORDERSTYLE_SOLID Solid border
SS_BORDERSTYLE_DASH Dash border
SS_BORDERSTYLE_DOT Dot border
SS_BORDERSTYLE_DASHDOT Dash dot border
SS_BORDERSTYLE_DASHDOTDOT Dash dot dot border
SS_BORDERSTYLE_BLANK Erases border and grid
SS_BORDERSTYLE_FINE_SOLID Thin solid border
SS_BORDERSTYLE_FINE_DASH Thin dash border
SS_BORDERSTYLE_FINE_DOT Thin dot border
SS_BORDERSTYLE_FINE_DASH_DOT Thin dash dot border
SS_BORDERSTYLE_FINE_DASH_DOT_DOT Thin dash dot dot border
Color Border color for specified cell
(Value can be SPREAD_COLOR_NONE, which specifies to use the default border 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

The following table illustrates the 12 available border styles:

Default

Solid

Dash

Dot

Dash Dot

Dash Dot Dot

Blank

Fine Solid

Fine Dash

Fine Dot

Fine Dash Dot

Fine Dash Dot Dot

Use the SSSetBorderRange function to specify the border characteristics for a block of cells.

You can set multiple styles and colors for one cell by calling the SSSetBorder or SSSetBorderRange function. For example, you can combine a dotted border for the left side of the cell with a dash dot border for the right side of the cell.

Note: Keep in mind the following information concerning cell borders:

You cannot return the cell border settings for a block of cells.

  • If two adjacent cells have different settings, the cell that is to the right or to the bottom has precedence. For example, if cell A1 is set to display a red border and cell A2 is set to display a blue border, all of cell A2's borders will be blue, and cell A1 will have red top, left, and bottom borders, and a blue right border.
    Keep in mind that the sheet is drawn from left to right and from top to bottom on the screen. Each subsequent cell's border properties take precedence over the cell drawn before it.
  • If you want to return the cell border style for a cell, you must specify the side for which you want to return the style using the wBorderType parameter. Alternatively, you can return the settings for a cell with multiple border settings using the SSGetBorderEx function.

For more information about cell border precedence, see Customizing Cell Borders.

Note: The top and left borders of the cell displayed in the top-left corner of the sheet are not displayed. Keep this in mind if you choose not to display a border for the Spread control or headers for the sheet, as the result might be visually confusing.

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

Customizing Cell Borders

SSGetBorderEx, SSSetSheet functions

ActiveX Correspondence

SSGetBorder: GetCellBorder method

SSSetBorder: SetCellBorder method

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