Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 18 in printed book and digital formats -- plus a one-year subscription (beginning with 19.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 9.4


Printing 201

The basics of printing styled text

Issue: 9.4 (May/June 2011)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 15,088
Starting Page Number: 72
Article Number: 9409
Resource File(s):

Download Icon 9409.zip Updated: 2011-05-02 17:49:28

Related Link(s): None

Excerpt of article text...

In our last issue I introduced the topic of printing by demonstrating a print-preview feature. However, that example did not support styled text. Today we'll look at printing styled text using Real Studio's styledTextPrinter object.

In the previous demo, any text formatting we did programmatically, via our printing code. For instance, I had a "title" checkbox that if you checked it, would center and bold the first lines of the text (presumably title and author, at least in the included example text). Today I've taken that same sample story and created an RTF file of it. This will preserve the text's formatting.

To do that, we first need to make our textArea support styled text by checking the styled property. Then in its Open event we put this code:

Sub Open()

dim tin as textInputStream

...End of Excerpt. Please purchase the magazine to read the full article.