欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Delphi實(shí)現(xiàn)檢測(cè)并枚舉系統(tǒng)安裝的打印機(jī)的方法

 更新時(shí)間:2014年07月29日 09:27:56   投稿:shichen2014  
這篇文章主要介紹了Delphi實(shí)現(xiàn)檢測(cè)并枚舉系統(tǒng)安裝的打印機(jī)的方法,需要的朋友可以參考下

本文以實(shí)例說(shuō)明Delphi打印程序的實(shí)現(xiàn)方法。該實(shí)例可以檢測(cè)系統(tǒng)中安裝的所有打印機(jī),枚舉出這些打印機(jī),主要功能代碼非常簡(jiǎn)單,便于大家閱讀與理解。

主要功能代碼如下:

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('沒(méi)有安裝打印機(jī)!');
 end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 Close;
end;

end.

相關(guān)文章

最新評(píng)論