Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 18.05.05 15:43 
Kann mir jemand den Quellcode fürs Ausdrucken eines Memos geben. Das Drucken-Turorial von delphisource.de ist too heavy für mich. In meinem app fehlt nur noch diese einzige Funktion. bitte helft mir?


Moderiert von user profile iconraziel: Topic aus VisualCLX (Component Library for Cross Platform) verschoben am So 22.05.2005 um 21:55
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mi 18.05.05 15:46 
nimm statt ner Memo ne TRichEdit, soweit ich weis, hat die eine Print Funktion... ansonsten setz den Text zeile für zeile auf Printer.Canvas und dann eben Drucken.. einfach mal Printer eingeben, markieren, F1 drücken...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 22.05.05 20:33 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Printers, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
F : Textfile;
FText : string;
begin
FText := Memo1.Text;

AssignPrn(f);
rewrite(f);
writeln(f, Ftext);
closefile(f);
end;

end.
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 22.05.05 20:35 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.EinfachDrucken1Click(Sender: TObject);
var
F : Textfile;
lines : integer;
begin
StatusBar1.Panels.Items[3].text:='Einfacher Druckvorgang. Bitte warten...';
assignprn(F);
rewrite(F);

Printer.Canvas.Font := Richedit1.Font;
for Lines := 0 to Richedit1.Lines.Count -1 do
writeln(F, RichEdit1.lines[lines]);
closefile(F);

StatusBar1.Panels.Items[3].text:='';
end;


Der Code von mir oben kommt mir komisch vor. Nimm den hier.