SSGetLock, SSSetLock, SSSetLockRange Functions
Applies To
fpSpread DLL control
Description
Set or return whether the user can type data into a cell, a row, a column, a block of cells, or the entire sheet.
Syntax
BOOL SSGetLock(HWND hWnd, SS_COORD Col, SS_COORD Row);
BOOL SSSetLock(HWND hWnd, SS_COORD Col, SS_COORD Row, BOOL Lock);
BOOL SSSetLockRange(HWND hWnd, SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, BOOL Lock);
BOOL TSpread::GetLock(SS_COORD Col, SS_COORD Row);
BOOL TSpread::SetLock(SS_COORD Col, SS_COORD Row, BOOL Lock);
BOOL TSpread::SetLockRange(SS_COORD Col, SS_COORD Row, SS_COORD Col2, SS_COORD Row2, BOOL Lock);
Parameters
The SSGetLock function has the following parameters:
Parameter | Description |
hWnd | Window handle of the fpSpread control |
Col | Column number of cell |
Row | Row number of cell |
The SSSetLock and SSSetLockRange 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 SSSetLockRange function |
Row | Row number of cell or row number of upper-left cell of the block if specifying a block for the SSSetLockRange function |
Col2 | Column number of lower-right cell of the block if specifying a block for the SSSetLockRange function |
Row2 | Row number of lower-right cell of the block if specifying a block for the SSSetLockRange function |
Lock | Determines whether cell is locked |
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 SSSetLockRange function to mark a block of cells as locked.
The user cannot type data into or change data in locked cells. You might want to lock calculated fields.
To lock a cell or cells, you must first mark the cells as locked using the SSSetLock or SSSetLockRange function. Set the Lock parameter to TRUE to mark the cell, block of cells, column, row, or sheet as locked.
The marked cells are just marked; they are not locked from access unless the SSSetBool function SSB_PROTECT option is set to TRUE (its default value).
Return Value
SSGetLock: TRUE if the specified cell is locked; FALSE otherwise.
SSSetLock, SSSetLockRange: TRUE if the function completes successfully; FALSE otherwise.
See Also
Marking Cells As Locked
Clearing Cells That Are Marked as Locked
SSGetLockColor, SSSetLockColor, SSSetSheet functions
ActiveX Correspondence
Lock property