Mega Code Archive

 
Categories / Delphi / Printing
 

How to Show the print dialog and print text files

Title: How to Show the print dialog and print text files unit Unit1; interface uses {...,}ComCtrls; type TForm1 = class(TForm) Button1: TButton; PrintDialog1: TPrintDialog; RichEdit1: TRichEdit; procedure Button1Click(Sender: TObject); {...} end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); begin if PrintDialog1.Execute then Richedit1.Print('Ltp1'); {Ltp1, Lpt2 are printers} end; end.