小问题,在线等!

rainbow0326 2003-08-21 07:32:23
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,我该怎么办啊
...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
renzy205 2003-08-22
  • 打赏
  • 举报
回复
btnbottomdlg没定义
rainbow0326 2003-08-22
  • 打赏
  • 举报
回复
樓上朋友的回答我試過了,還是不行啊
rainbow0326 2003-08-22
  • 打赏
  • 举报
回复
这是书上的一段关于打印对话框的例子,没提到btnbottomdlg是delphi声明的还是自己做的,我在帮助中没有查到这个类,但是如果是自己定义的应该提示一下啊
chl_ccssddnn 2003-08-22
  • 打赏
  • 举报
回复
btnbottomdlg肯定是一个对话框类,肯定是有个form,然后这个类从form继承过来。btnbottomdlg:Tform1;
btnbottomdlg:=Tform1.create(self);
具体的你看看有关调用第二个form的例子。
phenixSolon 2003-08-22
  • 打赏
  • 举报
回复
这个控件是自己做的。
rainbow0326 2003-08-22
  • 打赏
  • 举报
回复
这个我也知道,问题是怎么定义,这是什么类?
huojiehai 2003-08-21
  • 打赏
  • 举报
回复
procedure tmainform.openprintcanceldialog;
var
btnbottomdlg: Tbtnbottomdlg;
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;

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧