[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
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Collapse]PDF Viewer
   [Expand]Getting Started
    Coordinate Systems
   [Expand]Navigation
   [Expand]Access and Edit Document Content
   [Expand]Interactivity
    Deployment
   [Collapse]Examples
    [Expand]Getting Started
    [Expand]Interactive Form
    [Collapse]Text Markup Annotations
      How to: Create a Text Markup Annotation Programmatically
      How to: Specify the Text Markup Annotation Properties When the Annotation is being Created
    [Expand]Interactivity
    [Expand]Customization
    [Expand]Printing
   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: Specify the Text Markup Annotation Properties When the Annotation is being Created

Show Me

The complete sample project is available at https://github.com/DevExpress-Examples/how-to-specify-text-markup-annotation

This example demonstrates how to specify the text markup annotation properties when the annotation is being created in a document.

To add a markup to text:

  • Select the text;
  • Right-click the text and choose Highlight, Strikethrough or Underline item in the invoked context menu.

When the text markup annotation is being created in a document, the PdfViewer.TextMarkupAnnotationCreating event is raised. In this event, you can specify the annotation properties (for example, the default color used to underline a text using the PdfTextMarkupAnnotationCreatingEventArgs.Color property as shown in the code below).

You can see properties applied to a newly created annotation in the Annotation Properties dialog.

To open this dialog, right-click the annotation and choose the Properties… item in the context menu.

The Annotation Properties dialog is shown below.

The following code shows how to handle the PdfViewer.TextMarkupAnnotationCreating event.

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