Autor Beitrag
Michael15
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP Professional
Delphi 2, 3, 7, 8
BeitragVerfasst: Do 28.04.05 17:44 
Hallo Leute,
Ich habe einen Printdialog und eine Listbox.
Ich möchte nun den Inhalt der Listbox drucken.

Dann habe ich geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure drucken;
begin
  if form1.printdialog1.execute then
  ???;
end;


Was muss an der Stelle der Fragezeichen stehen, damit der Drucker die Listbox druckt mit ihren Eigenschaften(Schriftgröße,schriftfarbe usw.)???

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Do 28.04.05 17:47 
Benutz doch die Suche Suche in: Delphi-Forum, Delphi-Library DRUCKEN

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
Michael15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP Professional
Delphi 2, 3, 7, 8
BeitragVerfasst: Do 28.04.05 17:49 
dann steht da aber: Keine Eigenschaften entsprechen deinen Kriterien!!!
Kannst du mir bitte helfen???
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Do 28.04.05 18:07 
Schau mal hier:
www.delphi-forum.de/...ghlight=memo+drucken

Hier geht es um das Drucken eines MemoFeldes ist aber im Prizip das gleiche. Du musst z.B lines durch items ersetzen

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
Michael15 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76

Win XP Professional
Delphi 2, 3, 7, 8
BeitragVerfasst: Do 28.04.05 18:13 
das verstehe ich nicht, kannst du das vielleicht mal hier erklären und einfach nur die Zeile aufschreiben??? Danke
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 28.04.05 18:48 
das is net nur eine Zeile. Ersetz doch alle Memo1.lines... durch ListBox1.items...
Tobias1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 454

Win 98, XP Prof
D3 Prof, D2005 Prof
BeitragVerfasst: Do 28.04.05 19:03 
uses ..., Printers;
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
Line: Integer;
PrintText: TextFile; 
begin
if PrintDialog1.Execute then
begin
AssignPrn(PrintText);
Rewrite(PrintText); 
Printer.Canvas.Font := combobox1.Font;
for Line := 0 to combobox1.items.Count - 1 do
Writeln(PrintText, combobox.items[Line]); 
CloseFile(PrintText); 
end;

_________________
Auch das schlechteste Buch hat seine gute Seite: die letzte. (John Osborne)
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 29.04.05 14:16 
Es ging um Listboxen! Wenn schon dann mach es doch bitte richtig! :autsch:
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Fr 29.04.05 14:20 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
Line: Integer;
PrintText: TextFile; 
begin
if PrintDialog1.Execute then
begin
AssignPrn(PrintText);
Rewrite(PrintText); 
Printer.Canvas.Font := ListBox1.Font;
for Line := 0 to ListBox1.items.Count - 1 do
Writeln(PrintText, Listbox1.items[Line]); 
CloseFile(PrintText); 
end;


Außerdem würd ich
procedure Form1.drucken schreiben
:wink: