Autor Beitrag
danielpt
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Fr 08.08.03 15:21 
Frage: Wie kann ich einrichten, dass das Prog den "Drucken"-Dialog bringt und dann macht was der Benutzer eingibt bzw. einstellt?

Meine bisherige Source:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.SpeedButton13Click(Sender: TObject);
begin
 if RichEdit1.Text<>'' then begin
  Richedit1.Print('Dokument drucken');
 end;
end;


Hier druckt er aber immer gleich... Ohne Print-Dialog...

_________________
cu daniel
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Fr 08.08.03 15:44 
Hi,
du musst auf dein Form einen PrintDialog setzen.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if PrintDialog1.Execute then
begin
RichEdit1.print('Dokument drucken');
end;
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Fr 08.08.03 15:51 
naja, der Dialog kommt, wenn ich aber eingeben: "Exemplare: 14"(o.ä.) Dann druckt er trotzdem nur eine Seite...

_________________
cu daniel
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Fr 08.08.03 16:15 
Echt? Wie wäre es mit einer Schleife?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
Form1.Button1Click(Sender: TObject);
Var Anzahl: Integer;
begin
If PrintDialog1.Execute Then
Begin
For Anzahl:=1 To PrintDialog1.Copies Do
  RichEdit1.Print('Druckprogramm');
End
end;


... wobei ich "Dokument drucken" ein wenig unglücklich finde. Anstelle von "Druckprogramm" solltest du vielleicht den Namen des Tools einsetzen.. :-)

_________________
Hasta La Victoria Siempre
danielpt Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

Windows 2000 Professional SP4
D6 Personal
BeitragVerfasst: Fr 08.08.03 16:58 
thx, jetzt gehts...

_________________
cu daniel
freq.9
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP (RedHat 9)
Delphi 7.0 Ent
BeitragVerfasst: Fr 24.10.03 12:52 
Ma ne Frage:
Ich hab nu nen PrintDialog in mein Programm reingepackt aber wie bekomm ichs hin dass da son Drucken Fenster kommt und so ? Hab grad ma:
Zitat:
if PrintDialog1.Execute then
begin
RichEdit1.print('Dokument drucken');
end;

versucht aber dann meldet Delphi mit "undeclared identifer 'print'"

_________________
Admin of RealScripts
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Fr 24.10.03 18:52 
... das sollte eigentlich so gehen. Ich sehe keine Fehler. Hast du denn ein RichEdit auf der Form?

_________________
Hasta La Victoria Siempre
freq.9
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39

Win XP (RedHat 9)
Delphi 7.0 Ent
BeitragVerfasst: So 26.10.03 13:29 
ne das RichEdit is ne Memo, ist aber in meinem Code geändert (also es steht in meinem Code nicht RichEdit1.print sondern Textarea.Print [Textarea = Memo])

_________________
Admin of RealScripts
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Mo 27.10.03 18:48 
... so genau weiß ich es nicht, aber ich bin der Meinung, daß Memo kennt die Eigenschaft "Print" nicht. Gib einfach mal "Memo1." ein und warte ein wenig. Dann drück "p" und wenn "Print" vorhanden ist, sollte es auch auftauchen..

_________________
Hasta La Victoria Siempre
ErnestoChe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 528

Win 2000 pro, CRUX 2.0
Delphi 6 Pers, Open K3
BeitragVerfasst: Mo 27.10.03 19:17 
Hi,

ein Memo hat keine Druck-Methode wie ein RichEdit. Da musst du alles von Hand machen. Das geht mit der Funktion Printer aus der Unit Printers. Mach dich mal in der OH schlau. Da gibts sogar Beispielcode.

MFG

- Ernesto -