Back to Devexpress

Lesson 2 - Draw Simple Text

windowsforms-91-controls-and-libraries-printing-exporting-getting-started-lesson-2-draw-simple-text.md

latest1.2 KB
Original Source

Lesson 2 - Draw Simple Text

  • Aug 15, 2025
  • 3 minutes to read

This lesson shows you how to create a link that generates a document displaying the “Hello World!” text.

View Example: Get Started with Printing Library

To add text to a document via a printing link, do the following.

  1. To create a new printing link, declare a new class (called Lesson2 ) derived from the Lesson1 class defined in the previous lesson. The new class will have three constants: top (determines the top position), r (specifies the rectangle) and caption (contains the “Hello World!” text string).

  2. Next, modify the main form’s Load event handler to pass the Printing System of the Document Viewer to the new link.

Launch the application and view the result.

See Also

Lesson 3 - Draw Formatted Text