How to change the default font size in TDBRichViewEdit?

General TRichView support forum. Please post your questions here
Post Reply
Juergen
Posts: 9
Joined: Thu Nov 05, 2009 8:47 pm
Location: Germany

How to change the default font size in TDBRichViewEdit?

Post by Juergen »

Hello,

I need to change the default font size form 10 point to 8. I have try the following code at create time of the form:

Code: Select all

For i := 0 To DBRichTextEdit1.Editor.Style.TextStyles.Count - 1 Do
  DBRichTextEdit1.Editor.Style.TextStyles[i].Size := 8;
But the font size didn't change. What can I do?

Jürgen
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Call this code in OnNewDocument event.
Or, better, create the desired set of styles there:

Code: Select all

DBRichTextEdit1.Editor.Style.TextStyles.Clear;
with DBRichTextEdit1.Editor.Style.TextStyles.Add do begin
  Size := 8;
end;
Juergen
Posts: 9
Joined: Thu Nov 05, 2009 8:47 pm
Location: Germany

Post by Juergen »

Thanks for the hint.

That solve my problem.

Jürgen
Post Reply