Locked: TriState;
The Locked property determines whether the cell is protected from editing.
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.
To execute the example a form with a button named Button1 on it, a TabSheetBox component, and a UiTabSheet component named UiTabSheet1 are required. 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: