DBRichEdit font behavior
- From: "Chris L." <christopher.leongc@xxxxxxxxxxx>
- Date: Sat, 22 Apr 2006 17:25:16 GMT
Hi,
I hooked a DBRichEdit VCL to a memo field of my table. When I copied rich
text to the DBRichEdit control, it saved the font information also. When I
scroll to another record in the table, the DBRichEdit control kept the font
info of the first character of the last memo value. It is now displaying the
contents of the memo in that font.
I tried this to change the font
procedure TForm1.FontSizeChange(Sender: Tobject);
begin
if FontDialog1.Execute then
begin
DBRichEdit.SelStart := 0;
DBRichEdit.SelectAll;
DBRichEdit.Font := FontDialog1.Font;
DBRichEdit.Invalidate;
end;
end; // nothing happens unless a different font
or size is selected
of use
DBRichEdit.SetFocus;
DBRichEdit.SelectAll;
// toggle between plaintext and richtext
if not DBRichEdit.Plaintext then
DBRichEdit.PlainText := True
else
DBRichEdit.PlainText := False;
DBRichEdit.Invalidate; // also nothing happens unless a
different font or size is selected
If I use the default font of FontDialog1 nothing happens. What I meant is:
if the DBRichEdit is displaying text in Arial size 16, and FontDialog1
default is San Serif 8, nothing happens. DBRichEdit still displays text in
Arial 16. Why is that?
What is the best way to keep the display text in the design time font value
when scrolling through the table?
Thanks.
Chris
.
- Follow-Ups:
- Re: DBRichEdit font behavior
- From: Bart
- Re: DBRichEdit font behavior
- Prev by Date: Re: Windows APIs and virtual memory
- Next by Date: TStringGrid.DrawCell question
- Previous by thread: Windows APIs and virtual memory
- Next by thread: Re: DBRichEdit font behavior
- Index(es):
Relevant Pages
|