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

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

PrintPageEventArgs.HasMorePages プロパティ

追加ページ印刷するかどうかを示す値を取得または設定します

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

Dim instance As PrintPageEventArgs
Dim value As Boolean

value = instance.HasMorePages

instance.HasMorePages = value
public bool HasMorePages { get;
 set; }
public:
property bool HasMorePages {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_HasMorePages ()

/** @property */
public void set_HasMorePages (boolean value)
public function get HasMorePages
 () : boolean

public function set HasMorePages
 (value : boolean)

プロパティ
追加ページ印刷する場合trueそれ以外場合false既定値false です。

使用例使用例

次のコード例は、Form 上に Button作成されていることを前提にしています。例中の printButton_Click メソッドは、PrintDocument クラスインスタンス作成しpd_PrintPage メソッド呼び出しpd_PrintPage メソッド指定されている .bmp ファイル出力します。この例を実行するには、印刷するビットマップパス変更します

この例では、System.ComponentModelSystem.CollectionsSystem.Drawing、System.Drawing.Printing、System.ResourcesSystem.Windows.Forms の各名前空間使用します

' Specifies what happens when the user clicks the Button.
Private Sub printButton_Click(sender As
 Object, e As EventArgs)
    Try
        ' Assumes the default printer.
        Dim pd As New PrintDocument()
        AddHandler pd.PrintPage, AddressOf
 Me.pd_PrintPage
        pd.Print()
    Catch ex As Exception
        MessageBox.Show("An error occurred while printing",
 _
            ex.ToString())
    End Try
End Sub    

' Specifies what happens when the PrintPage event is raised.
Private Sub pd_PrintPage(sender As
 Object, ev As PrintPageEventArgs)
    ' Draw a picture.
    ev.Graphics.DrawImage(Image.FromFile("C:\My Folder\MyFile.bmp"),
 _
        ev.Graphics.VisibleClipBounds)
    
    ' Indicate that this is the last page to print.
    ev.HasMorePages = False
End Sub

// Specifies what happens when the user clicks the Button.
 private void printButton_Click(object sender,
 EventArgs e) 
 {
   try 
   {
     // Assumes the default printer.
     PrintDocument pd = new PrintDocument();
     pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
     pd.Print();
   }  
   catch(Exception ex) 
   {
     MessageBox.Show("An error occurred while printing",
 ex.ToString());
   }
 }
 
 // Specifies what happens when the PrintPage event is raised.
 private void pd_PrintPage(object sender, PrintPageEventArgs
 ev) 
 {      
   // Draw a picture.
   ev.Graphics.DrawImage(Image.FromFile("C:\\My Folder\\MyFile.bmp"), ev.Graphics.VisibleClipBounds);
      
   // Indicate that this is the last page to print.
   ev.HasMorePages = false;
 }
 
private:
   // Specifies what happens when the user clicks the Button.
   void printButton_Click( Object^ /*sender*/, EventArgs^ /*e*/
 )
   {
      try
      {
         // Assumes the default printer.
         PrintDocument^ pd = gcnew PrintDocument;
         pd->PrintPage += gcnew PrintPageEventHandler( this,
 &Form1::pd_PrintPage );
         pd->Print();
      }
      catch ( Exception^ ex ) 
      {
         MessageBox::Show( "An error occurred while printing",
 ex->ToString() );
      }
   }

   // Specifies what happens when the PrintPage event is raised.
   void pd_PrintPage( Object^ /*sender*/, PrintPageEventArgs^
 ev )
   {
      // Draw a picture.
      ev->Graphics->DrawImage( Image::FromFile( "C:\\My Folder\\MyFile.bmp"
 ),
         ev->Graphics->VisibleClipBounds );
      
      // Indicate that this is the last page to print.
      ev->HasMorePages = false;
   }
// Specifies what happens when the user clicks the Button.
private void printButton_Click(Object sender,
 EventArgs e)
{
    try {
        // Assumes the default printer.
        PrintDocument pd = new PrintDocument();
        pd.add_PrintPage(new PrintPageEventHandler(this.pd_PrintPage));
        pd.Print();
    }
    catch (System.Exception ex) {
        MessageBox.Show("An error occurred while printing",
 ex.ToString());
    }
} //printButton_Click

// Specifies what happens when the PrintPage event is raised.
private void pd_PrintPage(Object sender, PrintPageEventArgs
 ev)
{
    // Draw a picture.
    ev.get_Graphics().DrawImage(Image.FromFile
        ("C:\\My Folder\\MyFile.bmp"),
        ev.get_Graphics().get_VisibleClipBounds());

    // Indicate that this is the last page to print.
    ev.set_HasMorePages(false);
} //pd_PrintPage
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PrintPageEventArgs クラス
PrintPageEventArgs メンバ
System.Drawing.Printing 名前空間


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

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

辞書ショートカット

すべての辞書の索引

「PrintPageEventArgs.HasMorePages プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS