Print Page | Close Window

Applying Fonts to Text Objects

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=8061
Printed Date: 18 Apr 2024 at 6:36pm


Topic: Applying Fonts to Text Objects
Posted By: shiresmith
Subject: Applying Fonts to Text Objects
Date Posted: 20 Oct 2009 at 3:40am
I'm having problems applying fonts to text objects programmatically - specifically to text objects that are wrapped across more than one line.
 
The following code works fine
 
MyTextObject.ApplyFont(MyNewFont)
 
Where the text object contains a single line of text. Where it contains more than one line, the new font is applied to the first line only with the remaining lines exhibiting the font specified at design time.
 
I'm guessing I need to "select" all the text in the text object before applying the font, and indeed the Text property of the TextObject has a Select method. Sadly I can find no documentation on how to use the Select method, and the "intellisense" that Visual Studio throws up to help you means nothing to me whatsoever.
 
Here is what is displayed as "help" for the TextObject.Text.Select method
 
<extension> (Select (Of TResult) (selector as System.Func(Of Char, Integer, TResult))
 
Can anyone advise what I need to pass as parameters to the Select method to select the entire contents of the text Object, or another way to apply a font to the entire Text Object?



Print Page | Close Window