X15: Protected Documents Explained Simply
TX Text Control X15 supports password-based document protection via the EditMode property. Setting UsePassword combined with ReadAndSelect encrypts the document. When the file loads with EditMode set to Edit, a password dialog appears, and a correct entry restores full editing access.

Using TX Text Control X15, documents can be protected by restricting the formatting and editing of content. When protecting a document, it is possible to define whether the document is completely locked or formatting can be applied.
Technically, the document gets encrypted with a password. When this encrypted document is loaded, it is restricted or set to read-only. In order to edit the document, the password needs to be entered.

The following code sets the TXText
textControl1.EditMode = EditMode.UsePassword | EditMode.ReadAndSelect;
textControl1.Save("encrypted-document.tx", StreamType.InternalUnicodeFormat);
When the document is loaded and the EditMode property is set to Edit, a dialog box to enter a password is opened automatically:
textControl1.Load("encrypted-document.tx", StreamType.InternalUnicodeFormat);
textControl1.EditMode = EditMode.Edit;
If the entered password matches the password that has been used to encrypt the document, the document can be edited again.
Editable regions are exceptions within protected documents to provide specific users permissions to edit these regions while the rest of the document is read-only.
How these regions can be inserted and how to define the current user will be explained in one of the next blog entries. Stay tuned!
Also See
This post references the following in the documentation:
- TXText
Control. Text Control. Edit Mode Property
Windows Forms
Text Control combines the power of a reporting tool and an easy-to-use WYSIWYG word processor - fully programmable and embeddable in your Windows Forms application. TX Text Control .NET for Windows Forms is a royalty-free, fully programmable rich edit control that offers developers a broad range of word processing features in a reusable component for Visual Studio.
Related Posts
Windows FormsDocument ProtectionRelease
X15: Protected Documents Explained Simply - Part II
TX Text Control X15 uses EditableRegion objects to define editable sections inside protected documents. Each region accepts a UserName that restricts editing to a specific user. The…
TX Text Control 34.0 SP2 is Now Available: What's New in the Latest Version
TX Text Control 34.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…
TX Text Control 34.0 SP1 is Now Available: What's New in the Latest Version
TX Text Control 34.0 Service Pack 1 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…
Introducing TX Text Control 34.0: Your Next Leap in Document Processing
We are happy to announce the release of TX Text Control 34.0. This version is packed with new features and enhancements that will elevate your document processing experience. This version…
Sneak Peek: TX Text Control 34.0 Coming November 2025
We are excited to announce the upcoming release of TX Text Control 34.0, scheduled for November 2025. This update brings a host of new features and improvements to enhance your document processing…
