张
张剑波
Unregistered / Unconfirmed
GUEST, unregistred user!
如下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
ss:string;
hh:integer;
begin
hh:=5;
if not table1.Active then
table1.Active :=true ;
if not printdialog1.Execute then
exit ;
printer.begin
Doc ;
//printer.Canvas.font.PixelsPerInch:=getdevicecaps(printer.canvas.handle,logpixelsy);
while not table1.Eof do
begin
hh:=hh+40 ;
ss:=table1.Fields[0].AsString ;
ss:=ss+table1.Fields[1].AsString ;
ss:=ss+table1.Fields[2].asstring;
ss:=ss+table1.Fields[3].AsString ;
printer.Canvas.textout(20,20+hh, ss);
table1.next;
if hh >2000 then
exit;
end;
printer.EndDoc ;
table1.Active :=false;
end;
问题:
1。button按下后不打印,application结束后才打印,怎么办?
2。如何设置字体的大小?
3。如何知道canvas的能打印的宽、高?
procedure TForm1.Button1Click(Sender: TObject);
var
ss:string;
hh:integer;
begin
hh:=5;
if not table1.Active then
table1.Active :=true ;
if not printdialog1.Execute then
exit ;
printer.begin
Doc ;
//printer.Canvas.font.PixelsPerInch:=getdevicecaps(printer.canvas.handle,logpixelsy);
while not table1.Eof do
begin
hh:=hh+40 ;
ss:=table1.Fields[0].AsString ;
ss:=ss+table1.Fields[1].AsString ;
ss:=ss+table1.Fields[2].asstring;
ss:=ss+table1.Fields[3].AsString ;
printer.Canvas.textout(20,20+hh, ss);
table1.next;
if hh >2000 then
exit;
end;
printer.EndDoc ;
table1.Active :=false;
end;
问题:
1。button按下后不打印,application结束后才打印,怎么办?
2。如何设置字体的大小?
3。如何知道canvas的能打印的宽、高?