bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 Delphi Delphi 用程式碼進行印表機管理
查看: 2402|回復: 0
go

Delphi 用程式碼進行印表機管理 [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2012-10-1 14:53 |只看該作者 |倒序瀏覽 |打印
Delphi 可以透過 function Printer 來取得 TPrinter 的全域實例(Global Instance)來進行印表機的管理。
  1. //使用 Printer 函數要先引用 Printers 單元
  2. uses Printers;

  3. procedure TForm1.FormCreate(Sender: TObject);
  4. begin
  5.   //清空列表,加入印表機列表,列表切換到目前選定印表機
  6.   //cbPrinters: TComboBox;
  7.   cbPrinters.Clear;
  8.   cbPrinters.Items.Assign(Printer.Printers);
  9.   cbPrinters.ItemIndex := Printer.PrinterIndex;
  10. end;
複製代碼
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-5-8 18:30 , Processed in 0.008058 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.