SSGetBorder, SSSetBorder, SSSetBorderRange Functions
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
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);
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.
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
SSGetBorderEx, SSSetSheet functions
ActiveX Correspondence
SSGetBorder: GetCellBorder method
SSSetBorder: SetCellBorder method