Products Technologies Demo Docs Blog Support Company

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.

X15: Protected Documents Explained Simply

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.

Document protection diagram

The following code sets the TXTextControl.TextControl.EditMode property to UsePassword which can be only combined with EditMode.ReadAndSelect using the bitwise or operator.

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!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Also See

This post references the following in the documentation:

  • TXTextControl.TextControl.EditMode 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.

See Windows Forms products

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…


ASP.NETWindows FormsWPF

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…


ASP.NETWindows FormsWPF

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…


ActiveXASP.NETWindows Forms

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…


ASP.NETWindows FormsWPF

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…

Share on this blog post on: