Searched here but no answer:
I have a DBRichViewEdit with a RVStyles attached.
RVStyles has some TextStyles set, one of which is '0 - Normal Text' with SizeDouble set to 18
Now - I can insert an item (e.g. table) and beforehand search for and add a missing font size 9 - no problems there.
But for the life of me I cannot get the default font size - on an empty, newly inserted record field - to be point size 9 or sizeDouble 18. It's always point size 8.
I add a record, start typing in the field and it's always 8 point size.
How, in the simplest way possible, can I set the DBRichViewEdit to acquire a default font size 9 or sizedouble 18 whenever a new record is added using this edit component ??
thank
Alan
Default Font Size 8 point - need default 9 point Question
Re: Default Font Size 8 point - need default 9 point Question
I don't use the db stuff but I think the only way you can do it is by spinning through the text styles every time you add a record:
Code: Select all
for i := 0 to rv.Style.TextStyles.Count-1 do
rv.Style.TextStyles[i].Size := rv.Style.TextStyles[i].Size + FSize;
Stan
Re: Default Font Size 8 point - need default 9 point Question
Hmm, OK well I have decided to do it this way:
And I do that when I save my templates - that way the templates come back with no size 8 fonts
Alan
Code: Select all
DBRichViewEdit1.DeleteUnusedStyles(True, True, True);
for I := 0 to RVStyleEstimateItems.TextStyles.Count-1 do begin
if (RVStyleEstimateItems.TextStyles.Items[i].Size<9) then RVStyleEstimateItems.TextStyles[i].Size:=9;
end;
Alan
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Default Font Size 8 point - need default 9 point Question
Yes, you can call this procedure in DBRichViewEdit.OnNewDocument event.
You can call the code your posted in the last message, or simply create a new set of styles that will be default, such as:
The code above should be used if StyleTemplates are not used, i.e. if DBRichViewEdit1.UseStyleTemplates = False.
Otherwise, you should link text and paragraph style to the StyleTemplate named "Normal" and use its attributes (I can explain how, if you need).
You can call the code your posted in the last message, or simply create a new set of styles that will be default, such as:
Code: Select all
RVStyleEstimateItems.TextStyles.Clear;
RVStyleEstimateItems.ParaStyles.Clear;
RVStyleEstimateItems.ListStyles.Clear;
with RVStyleEstimateItems.TextStyles.Add do
begin
FontName := 'Tahoma';
Size := 9;
end;
RVStyleEstimateItems.ParaStyles.Add;
Otherwise, you should link text and paragraph style to the StyleTemplate named "Normal" and use its attributes (I can explain how, if you need).