Spread 8.0 Documentation
Lock Property
Support Options
ActiveX Reference > ActiveX Properties > Lock Property

Glossary Item Box

Lock Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns whether the specified cell or cells are marked as locked. This property is available at run time only.

Syntax

C++

BOOL CSpreadSheet::GetLock( );
void CSpreadSheet::SetLock(BOOL value);

Visual Basic

[form.]fpSpread.Lock[ = boolean%]

Remarks

You can specify that certain cells are locked; that is, the user cannot edit them. In addition, locked cells can display different background and text colors. You mark cells as locked using this property. Cells are not locked until the Protect property is set to True. Because the Protect property's default value is True, unless you have changed the value of the Protect property, when you mark them as locked, they are also locked.

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property. Before you set the Lock property, first specify the cells you want to mark as locked by using the instructions in Using Column and Row Properties.

Note that when the Protect property is False, the user can still interact with cells marked as locked. Also, when the Protect property is False, the cells that are marked as locked do not display the colors specified by the LockBackColor and LockForeColor properties.

If you use the Lock property to retrieve the lock status for a block of cells that do not all have the same lock status, the lock status of the active cell is returned.

Spread Designer

Specify the portion of the sheet for which you want to mark cells as locked using the instructions in Selecting an Item in Spread Designer. Then select Lock from the Cell menu.

In the Spread Designer, the Lock and Protect properties are temporarily reset to False when in design mode to assist you in the design process. When you switch to run-time mode, the sheet behaves according to the setting you have chosen for this property.

Data Type

Integer (Boolean)

See Also

Marking Cells As Locked
Clearing Cells That Are Marked as Locked

LockBackColor, LockForeColor, Protect, Sheet properties

DLL Correspondence

SSGetLock, SSSetLock, SSSetLockRange functions

Copyright © GrapeCity, inc. All rights reserved.