30-05-2017, 08:06 PM
30-05-2017, 09:52 PM
كود :
الارسال الى الطابعة مباشرة
With Printer do
Begin
Title:='';
BeginDoc;
end;
With Printer.Canvas do
Begin
Font.Name:='Times New Roman';
Brush.Style:=bsClear;
Font.Size:=30;
....
end;الكتابة الى ملف تم طباعة هذا الملف
كود :
uses Printer;
var
MyFile: TextFile;
i : Integer;
begin
AssignPrn(MyFile);
Rewrite(MyFile);
For i:=0 to ListBox.Items.Count-1 do
Writeln(MyFile, ListBox.Items[i]);
System.CloseFile(MyFile);
end;جرب هذا ايضا
كود :
ListBox1.PaintTo(Printer.Handle, 10, 10);