Gets or sets whether a cell is marked as locked from editing.
Syntax
Visual Basic (Declaration) | |
---|
Public Property Locked As Boolean |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As Cell
Dim value As Boolean
instance.Locked = value
value = instance.Locked |
C# | |
---|
public bool Locked {get; set;} |
Property Value
Boolean:
true if marked as locked;
false otherwise
Remarks
Example
This example locks the cell to prevent the user from editing the contents of the cell and sets the horizontal and vertical alignment for the contents of the cell.
C# | Copy Code |
---|
using FarPoint.Win.Spread;
using FarPoint.Win;
private void Form1_Load(object sender, System.EventArgs e)
{
FarPoint.Win.Spread.Cell acell;
acell = fpSpread1.ActiveSheet.Cells[0, 0];
fpSpread1.ActiveSheet.Cells[0, 0].Text = "Alignment";
acell.HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right;
acell.VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Top;
acell.Locked = true;
fpSpread1.ActiveSheet.Rows[0].Height = 80;
} |
Visual Basic | Copy Code |
---|
Imports FarPoint.Win.Spread
Imports FarPoint.Win
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim acell As FarPoint.Win.Spread.Cell
acell = FpSpread1.ActiveSheet.Cells(0, 0)
FpSpread1.ActiveSheet.Cells(0, 0).Text = "Alignment"
acell.HorizontalAlignment = FarPoint.Win.Spread.CellHorizontalAlignment.Right
acell.VerticalAlignment = FarPoint.Win.Spread.CellVerticalAlignment.Top
acell.Locked = True
FpSpread1.ActiveSheet.Rows(0).Height = 80
End Sub |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also