# DocumentPermissions.ReadOnly Property

> Gets or sets a value specifying whether the document is read only. Neither the document's text can be changed nor the document can be formatted. The default setting of this property is true.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 25.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > DocumentPermissions.ReadOnly Property
- **545 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentpermissions/readonly-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentpermissions/readonly-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentpermissions/readonly-property/llms-full.txt

---

### Description

Gets or sets a value specifying whether the document is read only. Neither the document's text can be changed nor the document can be formatted. The default setting of this property is true.

### Syntax

```csharp
public bool ReadOnly { get; set; }
```

```vbnet
Public Property [ReadOnly] As Boolean
```

### Examples

The following example configures document permissions for the current document by using `DocumentPermissions.ReadOnly`.

```csharp
DocumentPermissions documentPermissions = textControl.DocumentPermissions;

documentPermissions.ReadOnly = true;
if (documentPermissions.ReadOnly)
{
    Console.WriteLine("Document Permissions: Read Only is enabled.");
}

documentPermissions.ReadOnly = true;
documentPermissions.AllowPrinting = true;
```

```vbnet
Dim documentPermissions As DocumentPermissions = textControl.DocumentPermissions

documentPermissions.ReadOnly = True
If documentPermissions.ReadOnly Then
    Console.WriteLine("Document Permissions: Read Only is enabled.")
End If

documentPermissions.ReadOnly = True
documentPermissions.AllowPrinting = True
```

---

## Nearby

- **Previous:** [DocumentPermissions.AllowPrinting Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentpermissions/allowprinting-property/llms-full.txt)
- **Next:** [DocumentSettings Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/documentsettings/llms-full.txt)
