Changing a ppDBRichText Font at Run-time
I asked this a while back and Jim was very helpful but I don't think I ever
got it to work right. I want to reformat a RichText database field at
run-time to set to a standard font on the form.
This is my ppDBRichText.OnGetRichText() event:
procedure TfAPTEdit.ppNotesGetRichText(Sender: TObject; var Text: String);
var
R : TRichEdit;
begin
R := TRichEdit.Create(Self);
R.Parent := Self;
R.Text := APT.FieldByName('Notes').AsString;
R.SelectAll;
R.SelAttributes.Size := 12;
R.SelAttributes.Name := 'Verdana';
R.SelAttributes.Style := [];
Text := R.Text;
R.Free;
end;
What am I doing wrong? The point size never seems to print correctly,
though other formatting is removed.
Thanks for any assistance.
-Johnnie
got it to work right. I want to reformat a RichText database field at
run-time to set to a standard font on the form.
This is my ppDBRichText.OnGetRichText() event:
procedure TfAPTEdit.ppNotesGetRichText(Sender: TObject; var Text: String);
var
R : TRichEdit;
begin
R := TRichEdit.Create(Self);
R.Parent := Self;
R.Text := APT.FieldByName('Notes').AsString;
R.SelectAll;
R.SelAttributes.Size := 12;
R.SelAttributes.Name := 'Verdana';
R.SelAttributes.Style := [];
Text := R.Text;
R.Free;
end;
What am I doing wrong? The point size never seems to print correctly,
though other formatting is removed.
Thanks for any assistance.
-Johnnie
This discussion has been closed.
Comments
control:
procedure TfAPTEdit.ppNotesPrint(Sender: TObject);
begin
ppNotes.RichText := APT.FieldByName('Notes').AsString;
ppNotes.SelectAll;
ppNotes.SelAttributes.Size := 12;
ppNotes.SelAttributes.Name := 'Verdana';
ppNotes.SelAttributes.Style := [];
end;
It's always 2 minutes after I click [Send].
-Johnnie