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
| var
Line,H : integer;
MyPrinter: TPrinter;
test : integer;
begin
if PrintDialog1.Execute then
begin
MyPrinter := Printer;
MyPrinter.BeginDoc;
MyPrinter.Canvas.Font.Name := 'Arial';
MyPrinter.Canvas.Font.Size := 7;
H := MyPrinter.Canvas.TextHeight('Gg') + 2;
test := Listbox1.Items.Count-1;
for Line := 0 to test do
begin
MyPrinter.Canvas.TextOut(25, 25 + Line * H, ListBox1.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(250, 25 + Line * H, ListBox2.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(2000, 25 + Line * H, ListBox3.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(2300, 25 + Line * H, ListBox4.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(3300, 25 + Line * H, ListBox5.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(3600, 25 + Line * H, ListBox6.Items.Strings[Line]);
MyPrinter.Canvas.TextOut(4400, 25 + Line * H, ListBox7.Items.Strings[Line]);
end;
MyPrinter.EndDoc;
end;
end; |
Partager