[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Expand]RichEditControl Document
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    Spell Checking
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
    Traversing the Document
   [Expand]Visual Elements
    Services
    Events
    Commands
    Keyboard Shortcuts
    HTML Tag Support
   [Collapse]Examples
    [Expand]Files
    [Collapse]Text
      How to: Select Text Programmatically
      How to: Insert Text at the Cursor Position
      How to: Obtain the Document Position under the Mouse Pointer
      How To: Obtain Specific Document Part
      How to: Append Text to the Paragraph
      How to: Mark Text as Hidden and Display Hidden Text in the RichEditControl
    [Expand]Formatting
    [Expand]Styles
    [Expand]Lists
    [Expand]Pictures
    [Expand]Text Boxes
    [Expand]Tables
    [Expand]Document Elements
    [Expand]Layout
    [Expand]Automation
    [Expand]Search and Replace
    [Expand]Mail Merge
    [Expand]Spell Check
    [Expand]Export-Import
    [Expand]Printing
    [Expand]Protection
    [Expand]User Interface Customization
    [Expand]Commands
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Mark Text as Hidden and Display Hidden Text in the RichEditControl

The following example describes how to mark text as hidden and display hidden text in the RichEditControl.

Expanded Mark Text as Hidden

  1. Use the Range property to get the range occupied by the target text.
    Refer to the How to: Select Text Programmatically example for information on how to select text in code, and the How To: Obtain Specific Document Part topic for details on how to obtain specific document part.

  2. Call the SubDocument.BeginUpdateCharacters method to update the character properties. Pass the retrieved range to the method as a range parameter.

  3. Set the CharacterPropertiesBase.Hidden property to true to hide the text.

  4. Call the SubDocument.EndUpdateCharacters method to finalize the update.

The code sample below hides the third document paragraph.

Expanded Display Hidden Text

Set the FormattingMarkVisibilityOptions.HiddenText property to RichEditFormattingMarkVisibility.Visible to display hidden text in the RichEditControl. Access the property using the richEditControl.Options.FormattingMarkVisibility notation.

The image below illustrates how the RichEditControl displays hidden text.

Is this topic helpful?​​​​​​​