ITabCellStyle.Locked

Syntax

Locked: TriState;

Description

The Locked property determines whether the cell is protected from editing.

Comments

By default the property is set to TriState.OffOption. The value and formula of the cell can be edited as well. If the property is set to TriState.OnOption, the cell is protected from editing. The editing mode cannot be entered by pressing F2 or using the EditCell method. The Value or the Formula properties will be available to edit the cell value.

Example

Executing the example requires a form with the Button1 button located on it,, the TabSheetBox component, and the UiTabSheet component named UiTabSheet1. The UiTabSheet1 is a data source for the TabSheetBox component.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

TSheet: ITabSheet;

TRange: ITabRange;

Style: ITabCellStyle;

Begin

TSheet := UiTabSheet1.TabSheet;

TRange := TSheet.View.Selection.Range;

Style := TRange.Style;

Style.Locked := TriState.OnOption;

End Sub Button1OnClick;

Click the button to set protection from editing for a selected cell range.

See also:

ITabCellStyle