Delphi 打印
2016-03-04 14:47
363 查看
procedure TForm1.PrinterSetupExecute(Sender: TObject); begin PrinterSetupDialog1.Execute; end; procedure TForm1.PrintExecute(Sender: TObject); begin //列印分页 if PrintDialog1.Execute=True then RichEdit1.Print(Form1.Caption); end; or if printdialog1.execute then PrintStrings(RichEdit1.Lines); uses ComCtrls; procedure PrintTXT(const txtFileName:string); var t:TRichEdit; begin try t := TRichEdit.Create(nil); t.Lines.LoadFromFile(txtFileName); t.Print(t.text); finally FreeAndNil(t); end; end; 直接调用该函数即可 PrintTXT('D:\abc\123.txt');
相关文章推荐
- Delphi Code Editor 之 几个特性(转)
- Delphi历史版本介绍(二)从Delphi8到DelphiXE3
- Delphi历史版本介绍(一)从Delphi1到Delphi7
- Delphi的DLL里如何实现定时器功能?
- Delphi安装NT服务程序时,不出现提示信息
- Delphi XE2 升级项目编译ralease版本,无法添加UAC解决方法
- 让Delphi XE2程序支持UAC
- DELPHI XE7 新的并行库
- DELPHI7在WIN8和WIN10下安装和运行
- delphi中无类型文件读写
- delphi之完美Splash方案(在TfrmMain.FormCreate里不断调用TfrmSplash显示加载进度文字,并且及时Update显示)
- DELPHI字符串、数组操作函数
- delphi 如何比较两个二维数组是否相等
- delphi获得当前鼠标坐标
- Delphi通过查找字符定位TADOQuery数据的位置
- Delphi在DBGridEh改变选中行颜色
- 未安装excel delphi listview导出到excel
- delphi程序在自身EXE后(插入)追加文件、数据
- delphi在64位系统下写注册表注意事项
- Delphi DBGrid图显用法