Delphi Programming / Object Pascal
サイトのトップページへ リンクのページへ ロゴマーク
[掲載 2000年05月07日] [更新 2006年10月20日] プリンタ設定コンポーネント
   
プリンタ設定コンポーネント
プリンタ名とプリンタ番号のプロパティ
動作確認等 -





凡例  published
 public
 ReadOnly



プリンタ名とプリンタ番号


プリンタ名を変更すると,変更後のプリンタのデフォルト値で初期化されます.

 PrinterName String プリンタ名
設定には Printer.Printers[Printer.PrinterIndex] の値を使用できる
空文字列を与えると [通常使用するプリンタ] の指定と同じ
取得文字列にはポート名は含まれない
 PrinterNumber Integer プリンタ番号.
存在しない番号を指定すると [通常使用するプリンタ]
 Port String LPT1: などのポート名
Windows 2000, Windows XP 以降では常に空文字


本コンポーネントで扱うプリンタを,通常使用するプリンタに設定します.


リスト1 
Printer.PrinterIndex := -1;
plSetPrinter1.PrinterName := Printer.Printers[Printer.PrinterIndex];


本コンポーネントで扱うプリンタを,現在のプリンタに設定します.


リスト2 
plSetPrinter1.PrinterName := Printer.Printers[Printer.PrinterIndex];