Board index » cppbuilder » Changing RichEdit Font?

Changing RichEdit Font?

I am having trouble setting the font size of the RichEdit when I run my
program at a different screen resolution than what the design resolution
was.
Our application will display a small text file that gets downloaded from
our
instrument.  When I run it on my development system at 1024 x 768 the
RichEdit will display all 40 columns of the text but if I try to run it
on a
computer with 800 x 600 or 640 x 480 the font is so big that the lines
wrap
or I need to use the horizontal scroll bar.  I'm using the ScaleBy( )
after
getting the Screen Ratio but this only changes the RichEdit window size
not
the font that it uses.  I'd like to just change the font size depending
on the
ScreenRatio. I just seem to get the RichEdit font to change even if I
use
"RichEdit1->Font->Size = 8" in the Form Create.

Richard Cooke

 

Re:Changing RichEdit Font?


Quote
Richard Cooke wrote:

> I am having trouble setting the font size of the RichEdit when I run my
> program at a different screen resolution than what the design resolution
> was.

Have you checked out this site? :
http://home.att.net/~robertdunn/Yacs.html

Microsoft (maybe) knows more about RichEdit -- but -they- don't have a
clue to the interactions with BCB!

HTH

Bob

Re:Changing RichEdit Font?


The following all work for me using BCB4; either before or after
LoadFromFile. If you test and calculate your preferred size it should work.

RepRE->Font->Assign(FontDialog1->Font); // On apply for font dialog

  RepRE->Font->Name = "Lucida Console";
    RepRE->Font->Size = font; // font is user input size
   RepRE->Font->Name = "Lucida Console";
      RepRE->Font->Size = 10;

HTH.

Quote
Richard Cooke wrote:
> I am having trouble setting the font size of the RichEdit .....

Other Threads