Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Sep 17, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Rich text set default font

How do I control the font size in a rich text edit? I am pulling text from a variable and applying it to a rich text edit by:
rte_1.ReplaceText (ls_text)
Under PB 5.0 one font is used, and under PB 6.5 another font is used. Can I control the font size and type?

You need to default the font in the RTF control by loading a piece of RTF into the control before you paste in your text.

The best way to do this is to switch on the RTF toolbar, create a single space, and set the font and height you want. Save the RTF to disk and then copy the resulting rtf file into the clipboard. Set this copied text into a variable in your code so that when the window opens the RTF code is pasted into the control.

Then when you paste in your plain text it will be the correct font.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date