•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 402,632 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,299 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
This Delphi procedure sends the text contained in a multiline editbox (memo in Delphi lingo) to a printer. The font and font size can be specified.
// send the lines of a multiline editbox (memo) to the printer // the form contains at least three components: // a Button, a MemoBox named TotalCost and a PrintDialog // note that BLANK is just a space character // Delphi 3.0 procedure TForm1.PrintTotalButtonClick(Sender: TObject); var POutput: TextFile; k: Integer; begin if PrintDialog1.Execute then begin AssignPrn(POutput); Rewrite(POutput); Printer.Canvas.Font.Name := 'Courier New'; Printer.Canvas.Font.Size := 8; Writeln(POutput,BLANK); Writeln(POutput,BLANK); Writeln(POutput,BLANK); for k := 0 to TotalCost.Lines.Count - 1 do Writeln(POutput, ' ' + TotalCost.Lines[k]); CloseFile(POutput); end; end;
Post Comment
•
•
•
•
DaniWeb Marketplace (Sponsored Links)