Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Rich text set default font

Question:
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.SelectTextAll()
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?

Answer:
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.

 

 

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