Multiple Fonts in one Text Box Control

jalge

Registered User.
Local time
Today, 14:19
Joined
Apr 14, 2003
Messages
24
Is there a way to use multiple fonts in one text box control on a report, where the text box is made up of strings and variables?

For example, I have the variables CaseName and CaseCite, which I want to appear printed on my report as in the following example:

This in the matter of State v. John Adams. Fed 2d 122

Where "State v. John Adams" and "Fed 2d 122" are the variables.

The variables are taken from an interactive pop up form the user uses when requesting the report.
 
Nope. You would have to have separate controls, which will throw out your alignment.

You could merge the report to Word. Word will apply different formats to each field or whatever you want, and will handle the spacing, line and page wrapping.
 
You can also use AddIns, RichText is one and I think there's another from FMS
 
Thanks all for your help. Guess I'll "get what I need" here instead of what I really want.

:D
 
Actually, there is a workaround that can give the illusion of having several fonts in one text box. The only restriction is that you need to stick to fixed width fonts.

In your case, you would need to break out John Adams as a second variable.

In the report, create two text boxes (or one text box for each font). Each one must have a transparent background.

In your case, you would concatinate the first variable (now only "State v.") with Space(Len(second variable)) and with the third variable. So you have
State v.------------Fed 2d 122. (the hyphens here represent the spaces generated by the Space() function, which wouldn't show up here on the web site.)
In the second variable, you would concatinate Space(Len(first variable) with the second variable ("John Adams"). This would give you
--------John Adams
When one text box is laid over the other, you have the appearance of two fonts in the same text box. The only requirement is that both fonts be fixed width fonts of the same size.

I guess, if you really have too much time on your hands, you could create some kind of relationship between letters and space widths for variable width fonts to make it work with them too.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom