PrintDocument.PrinterSettings プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > PrintDocument.PrinterSettings プロパティの意味・解説 

PrintDocument.PrinterSettings プロパティ

ドキュメント印刷するプリンタ取得または設定します

名前空間: System.Drawing.Printing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Property PrinterSettings As
 PrinterSettings
Dim instance As PrintDocument
Dim value As PrinterSettings

value = instance.PrinterSettings

instance.PrinterSettings = value
public PrinterSettings PrinterSettings { get;
 set; }
public:
property PrinterSettings^ PrinterSettings {
    PrinterSettings^ get ();
    void set (PrinterSettings^ value);
}
/** @property */
public PrinterSettings get_PrinterSettings ()

/** @property */
public void set_PrinterSettings (PrinterSettings
 value)
public function get PrinterSettings
 () : PrinterSettings

public function set PrinterSettings
 (value : PrinterSettings)

プロパティ
ドキュメント印刷する場所と方法指定する PrinterSettings。既定値は、プロパティ既定値設定されている PrinterSettings です。

解説解説
使用例使用例

指定したプリンタ上でドキュメント印刷するコード例次に示します。この例は、次の 3 つのことを前提にしています。変数 filePath出力先ファイル パス設定されていること、PrintPage イベント処理するメソッド pd_PrintPage定義されていること、および変数 printerプリンタ名が設定されていることです。

この例では、System.Drawing、System.Drawing.Printing、および System.IO の各名前空間使用します

Public Sub Printing()
    Try
        streamToPrint = New StreamReader(filePath)
        Try
            printFont = New Font("Arial",
 10)
            Dim pd As New
 PrintDocument()
            AddHandler pd.PrintPage, AddressOf
 pd_PrintPage
            ' Specify the printer to use.
            pd.PrinterSettings.PrinterName = printer
            pd.Print()
        Finally
               streamToPrint.Close()
        End Try
    Catch ex As Exception
        MessageBox.Show(ex.Message)
    End Try
End Sub    
   
public void Printing()
{
  try
  {
     streamToPrint = new StreamReader (filePath);
     try
     {
        printFont = new Font("Arial", 10);
        PrintDocument pd = new PrintDocument(); 
        pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
        // Specify the printer to use.
        pd.PrinterSettings.PrinterName = printer;
        pd.Print();
     } 
     finally
     {
        streamToPrint.Close();
     }
  } 
  catch(Exception ex)
  { 
     MessageBox.Show(ex.Message);
  }
}

public:
   void Printing()
   {
      try
      {
         streamToPrint = gcnew StreamReader( filePath );
         try
         {
            printFont = gcnew System::Drawing::Font( "Arial",10 );
            PrintDocument^ pd = gcnew PrintDocument;
            pd->PrintPage += gcnew PrintPageEventHandler(
               this, &Form1::pd_PrintPage );
            // Specify the printer to use.
            pd->PrinterSettings->PrinterName = printer;
            pd->Print();
         }
         finally
         {
            streamToPrint->Close();
         }
      }
      catch ( Exception^ ex ) 
      {
         MessageBox::Show( ex->Message );
      }
   }
public void Printing()
{
    try {
        streamToPrint = new StreamReader(filePath);
        try {
            printFont = new Font("Arial", 10);
            PrintDocument pd = new PrintDocument();
            pd.add_PrintPage(new PrintPageEventHandler(pd_PrintPage));

            // Specify the printer to use.
            pd.get_PrinterSettings().set_PrinterName(printer);
            pd.Print();
        }
        finally {
            streamToPrint.Close();
        }
    }
    catch (System.Exception ex) {
        MessageBox.Show(ex.get_Message());
    }
} //Printing
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PrintDocument クラス
PrintDocument メンバ
System.Drawing.Printing 名前空間
PrintDocument.DefaultPageSettings プロパティ
PrintDocument.DocumentName プロパティ
PrintDocument.PrintController プロパティ
PrinterSettings


このページでは「.NET Framework クラス ライブラリ リファレンス」からPrintDocument.PrinterSettings プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からPrintDocument.PrinterSettings プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からPrintDocument.PrinterSettings プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PrintDocument.PrinterSettings プロパティ」の関連用語

PrintDocument.PrinterSettings プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PrintDocument.PrinterSettings プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS