小问题,在线等!
implementation
uses printers;
{$r *.dfm}
procedure TMainForm.print1Click(Sender: TObject);
var
distanceline,line:longint;
printtext:system.text;
begin
if PrintDialog1.execute then ;
begin
printer.canvas.font:=memo1.Font;
distanceline:=trunc(1.5*fontdialog1.font.size);
openprintcanceldialog;
printer.begindoc;
for line:=0 to memo1.lines.Count-1 do
begin
printer.canvas.textout(0,distanceline*line,memo1.lines[line]);
end;
printer.enddoc;
btnbottomdlg.free;
end;
end;
procedure tmainform.openprintcanceldialog;
begin
btnbottomdlg:=tbtnbottomdlg.create(application);
btnbottomdlg.show;
btnbottomdlg.canvas.brush.color:=clactiveborder;
btnbottomdlg.canvas.textout(50,20,'print'+filename);
btnbottomdlg.canvas.textout(30,40,'if you want to stop,please choice
cancel botton.');
end;
end;
end;
这是书上的一段程序,运行时总提示undeclared indentifier:‘btnbottomdlg’,是怎么回事呢?
还有在btnbottomdlg.free;处提示我missing operater cemicolon,我该怎么办啊