officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-field-6a449a36.md
Gets or sets whether the field is locked.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
bool Locked { get; set; }
Property Locked As Boolean
| Type | Description |
|---|---|
| Boolean |
true , to lock the field; otherwise, false.
|
If the field’s Locked property is true , this field is not updated. You can set the FieldOptions.UpdateLockedFields option to UpdateLockedFields.Always to update locked fields.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Locked property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
how-to-use-docvariable-fields/CS/DocumentVariablesExample/Form1.cs#L29
#region #lockfields
richEditControl1.Document.Fields[0].Locked = true;
richEditControl2.Options.Fields.UpdateLockedFields = UpdateLockedFields.Never;
word-document-api-use-docvariable-fields/CS/Program.cs#L22
//Lock the first field to prevent updates
document.Fields[0].Locked = true;
how-to-use-docvariable-fields/VB/DocumentVariablesExample/Form1.vb#L29
#Region "#lockfields"
richEditControl1.Document.Fields(0).Locked = True
richEditControl2.Options.Fields.UpdateLockedFields = UpdateLockedFields.Never
word-document-api-use-docvariable-fields/VB/Program.vb#L16
' Lock the first field to prevent updates
document.Fields(0).Locked = True
See Also