| View previous topic :: View next topic |
| Author |
Message |
Kirbster Member
Joined: 24 Oct 2003 Posts: 3
|
Posted: 24/10/03 16:50 Post subject: Printing content of a memo |
|
|
Hello,
I am new to these forums, and quite new in Delphi programming (already one year of experience, but I've been learning everything by myself). I need help in printing contents of a TMemo component. I have NO idea how to do it.
Kirbster |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 250
|
Posted: 24/10/03 19:25 Post subject: |
|
|
| If you use a TRichEdit instead of TMemo, or just before printing the text assign it to a Rich Edit control, you may find theTPrintPreview component useful. |
|
| Back to top |
|
 |
Johnny_Bit Junior Member
Joined: 15 Jun 2003 Posts: 98
|
Posted: 25/10/03 07:56 Post subject: |
|
|
| Code: | var
RE: TRichEdit;
begin
RE:=TRichEdit.Create(Self);
re.Visible:=False;
Re.Parent:=Self;
Re.PlainText:=True;
Re.Font:=Main.CurrentEditor.Font;
Re.WordWrap:=Main.CurrentEditor.WordWrap;
Re.Lines:=Main.CurrentEditor.Lines;
ppPrint.BeginDoc;
ppPrint.PaintRichText(Rect(Margins.Left,Margins.Top,ppPrint.PaperWidth - Margins.Right, ppPrint.PaperHeight-Margins.Bottom),RE, -1, nil);
ppPrint.EndDoc;
Re.Free;
end; |
|
|
| Back to top |
|
 |
|