Thema: Delphi ListBox Drucken??

Einzelnen Beitrag anzeigen

Sascha_OW

Registriert seit: 4. Aug 2005
Ort: Owschlag
129 Beiträge
 
Delphi 2005 Professional
 
#8

Re: ListBox Drucken??

  Alt 30. Nov 2005, 11:34
Kann mir einer sagen wie ich Listboxen drucken kann wenn ich mehrere habe die mit Tabulatoren gedruckt werden sollen. Sprich ich habe 4 Listboxen und die sollen auf dem Druck in 4 Spalten vom Blatt eingetragen werden. Ich kann ich das am besten lösen
Meine Druck Functuon kommt von www.visualbasic5.de

Delphi-Quellcode:
procedure PrintTextboxContent(Source: TStrings);
        // TStrings : TStrings is the base class for objects that represent a list of strings.
var
        (*
          A file is an ordered set of elements of the same type. Standard I/O
          routines use the predefined TextFile or Text type, which represents a
          file containing characters organized into lines.
        *)

        filetype: TextFile;
        n: Word; // *** Laufvariable : Word   0..65535 unsigned 16-bit
begin
        // *** Assigns a text-file variable to the printer.
        AssignPrn(filetype);
        try
                // Rewrite : Creates a new file and opens it.
                Rewrite(filetype);
        try
                // for n ... Anzahl der Zeilen in dem Textfeld Memo1
                for n := 0 to Source.Count -1 do
                // Writes to a text file and adds an end-of-line marker
                writeln(filetype, Source.Strings[n]);

        finally
                // Terminates the association between file variable and an
                // external disk file.
                CloseFile(filetype);
        end;
        except
                (* EInOutError = EInOutError is the exception class for file
                input/output errors.
                *)

                on EInOutError do
                        MessageDlg('Error...', mtError, [mbOk], 0);
        end;
end;
Sascha Schwarz
  Mit Zitat antworten Zitat