Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi memo ausdrucken (https://www.delphipraxis.net/4259-memo-ausdrucken.html)

MAarkus_R19 21. Apr 2003 15:15


memo ausdrucken
 
hi wie kann ich ein einfaches memofeld ausdrucken
aus den delphi büchern werd ich ned schlau
thx

Haegar 21. Apr 2003 15:47

kennst du schon so die grundlegenden druckbefehle??
oder noch gar nix in der richtung?

gruss haegar

APP 21. Apr 2003 17:22

Hallo,

Zitat:

Q: How can I print all of the lines within a TMemo or TListbox component?

A: The function below accepts a TStrings object as a parameter and prints
out each string to the default printer. Because it uses a TStrings, the
function will work with any type of component that contains a
TStrings-type property, such as a TDBMemo or TOutline.
Delphi-Quellcode:
{ Begin code listing }

uses Printers;

procedure PrintStrings(Strings: TStrings);
var
  Prn: TextFile;
  i: word;
begin
  AssignPrn(Prn);
  try
    Rewrite(Prn);
    try
      for i := 0 to Strings.Count - 1 do
        writeln(Prn, Strings.Strings[i]);
    finally
      CloseFile(Prn);
    end;
  except
    on EInOutError do
      MessageDlg('Error Printing text.', mtError, [mbOk], 0);
  end;
end;

{ End code listing }
Zitat:

To print out the contents of a TMemo or TListbox, use the following
code:
Delphi-Quellcode:
PrintStrings(Memo1.Lines);

or

PrintStrings(Listbox1.Items);
gefunden auf codecentral.borland.com


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz