Delphi實(shí)現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機(jī)的方法
本文以實(shí)例說明Delphi打印程序的實(shí)現(xiàn)方法。該實(shí)例可以檢測系統(tǒng)中安裝的所有打印機(jī),枚舉出這些打印機(jī),主要功能代碼非常簡單,便于大家閱讀與理解。
主要功能代碼如下:
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,Printers, XPMan; type TForm1 = class(TForm) Button1: TButton; GroupBox1: TGroupBox; Memo1: TMemo; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin Memo1.Clear; memo1.Lines.Assign(Printer.Printers); if trim(memo1.Text) = '' then begin showmessage('沒有安裝打印機(jī)!'); end; end; procedure TForm1.Button2Click(Sender: TObject); begin Close; end; end.
上一篇:delphi7連接mysql5的實(shí)現(xiàn)方法
欄 目:Delphi
下一篇:Delphi實(shí)現(xiàn)圖片滾動(dòng)切換的完整實(shí)例代碼
本文標(biāo)題:Delphi實(shí)現(xiàn)檢測并枚舉系統(tǒng)安裝的打印機(jī)的方法
本文地址:http://mengdiqiu.com.cn/a1/Delphi/8623.html
您可能感興趣的文章
- 01-10在Delphi實(shí)現(xiàn)在數(shù)據(jù)庫中存取圖像的圖文演示無錯(cuò)
- 01-10delphi建立、讀取、存貯INI文件的方法《三》
- 01-10Delphi Command模式
- 01-10delphi 正弦曲線圖
- 01-10delphi建立、讀取、存貯INI文件的方法《二》
- 01-10插件管理框架 for Delphi(二)
- 01-10插件管理框架 for Delphi(一)
- 01-10Delphi中判斷文件是否為文本文件的函數(shù)
- 01-10delphi中一個(gè)值得大家來考慮的DLL問題
- 01-10初探Delphi中的插件編程


閱讀排行
本欄相關(guān)
- 01-10在Delphi實(shí)現(xiàn)在數(shù)據(jù)庫中存取圖像的圖
- 01-10delphi建立、讀取、存貯INI文件的方法
- 01-10delphi 正弦曲線圖
- 01-10Delphi Command模式
- 01-10delphi建立、讀取、存貯INI文件的方法
- 01-10插件管理框架 for Delphi(二)
- 01-10插件管理框架 for Delphi(一)
- 01-10Delphi中判斷文件是否為文本文件的函
- 01-10delphi中一個(gè)值得大家來考慮的DLL問題
- 01-10初探Delphi中的插件編程
隨機(jī)閱讀
- 01-11Mac OSX 打開原生自帶讀寫NTFS功能(圖文
- 01-10delphi制作wav文件的方法
- 08-05dedecms(織夢(mèng))副欄目數(shù)量限制代碼修改
- 01-10使用C語言求解撲克牌的順子及n個(gè)骰子
- 04-02jquery與jsp,用jquery
- 08-05織夢(mèng)dedecms什么時(shí)候用欄目交叉功能?
- 08-05DEDE織夢(mèng)data目錄下的sessions文件夾有什
- 01-10C#中split用法實(shí)例總結(jié)
- 01-11ajax實(shí)現(xiàn)頁面的局部加載
- 01-10SublimeText編譯C開發(fā)環(huán)境設(shè)置