Page 1 of 1

How to change the default font size in TDBRichViewEdit?

Posted: Mon Jan 25, 2010 11:36 am
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

Posted: Mon Jan 25, 2010 3:51 pm
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;

Posted: Tue Jan 26, 2010 11:31 am
by Juergen
Thanks for the hint.

That solve my problem.

Jürgen