PageSettings クラスとは? わかりやすく解説

PageSettings クラス

単一印刷ページ適用する設定指定します

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

<SerializableAttribute> _
Public Class PageSettings
    Implements ICloneable
[SerializableAttribute] 
public class PageSettings : ICloneable
[SerializableAttribute] 
public ref class PageSettings : ICloneable
/** @attribute SerializableAttribute() */ 
public class PageSettings implements ICloneable
SerializableAttribute 
public class PageSettings implements ICloneable
解説解説

PageSettings クラス使用してページ印刷方法変更する設定指定します通常、PrintDocument.DefaultPageSettings プロパティ使用して印刷するすべてのページ既定設定指定しますページごとに設定指定するには、PrintDocument.PrintPage イベントまたは PrintDocument.QueryPageSettings イベント処理しそれぞれ PrintPageEventArgs または QueryPageSettingsEventArgs に含まれる PageSettings 引数変更します

PrintDocument イベント処理詳細については、PrintDocument クラストピック概要参照してください印刷詳細については、System.Drawing.Printing 名前空間トピック概要参照してください

使用例使用例

PrintDocument.DefaultPageSettings プロパティ使用して文書既定用紙方向を横に設定しPrint メソッド使用して文書印刷するコード例次に示します。この例には、次の 3 つの必要条件あります

この例では、System.DrawingSystem.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
            pd.PrinterSettings.PrinterName = printer
            ' Set the page orientation to landscape.
            pd.DefaultPageSettings.Landscape = True
            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);
       pd.PrinterSettings.PrinterName = printer;
       // Set the page orientation to landscape.
       pd.DefaultPageSettings.Landscape = true;
       pd.Print();
     } 
     finally {
       streamToPrint.Close() ;
     }
   } 
   catch(Exception ex) { 
     MessageBox.Show(ex.Message);
   }
 }
 
public:
   void Printing()
   {
      try
      {
         streamToPrint = gcnew StreamReader( filePath );
         try
         {
            printFont = gcnew Font( "Arial",10 );
            PrintDocument^ pd = gcnew PrintDocument;
            pd->PrintPage += gcnew PrintPageEventHandler(
               this, &Sample::pd_PrintPage );
            pd->PrinterSettings->PrinterName = printer;
            // Set the page orientation to landscape.
            pd->DefaultPageSettings->Landscape = true;
            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));
            pd.get_PrinterSettings().set_PrinterName(printer);

            // Set the page orientation to landscape.
            pd.get_DefaultPageSettings().set_Landscape(true);
            pd.Print();
        }
        finally {
            streamToPrint.Close();
        }
    }
    catch (System.Exception ex) {
        MessageBox.Show(ex.get_Message());
    }
} //Printing
継承階層継承階層
System.Object
  System.Drawing.Printing.PageSettings
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PageSettings メンバ
System.Drawing.Printing 名前空間
PrintDocument
PrinterSettings



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

辞書ショートカット

すべての辞書の索引

「PageSettings クラス」の関連用語

PageSettings クラスのお隣キーワード
検索ランキング

   

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



PageSettings クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS