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

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

PageSettings.PaperSource プロパティ

ページ給紙方法取得または設定します (たとえば、プリンタの上トレイ)。

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

Public Property PaperSource As
 PaperSource
Dim instance As PageSettings
Dim value As PaperSource

value = instance.PaperSource

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

/** @property */
public void set_PaperSource (PaperSource value)
public function get PaperSource
 () : PaperSource

public function set PaperSource
 (value : PaperSource)

プロパティ
プリンタ給紙方法指定する PaperSource。既定値は、プリンタ既定給紙方法です。

例外例外
例外種類条件

InvalidPrinterException

PrinterSettings.PrinterName プロパティ指定されプリンタ存在しないか、既定プリンタインストールされていません。

解説解説

PaperSource は、PaperSourceKind 値の 1 つ格納されている PaperSource.Kind プロパティ使用してプリンタ給紙方法表します

ページPaperSource プロパティ有効な PaperSource設定します。これは、PrinterSettings.PaperSources コレクションから取得できます

使用例使用例

comboPaperSource コンボ ボックス選択されている給紙方法基づいた用紙給紙方法を含む、ドキュメント既定ページ3 つのプロパティ設定しPrint メソッド使用して文書印刷するコード例次に示します。この例では、printDoc という名前の PrintDocument 変数と、特定のコンボ ボックス存在することが必要条件となってます。

Private Sub MyButtonPrint_Click(ByVal
 sender As System.Object, ByVal e As
 System.EventArgs) Handles MyButtonPrint.Click

    ' Set the paper size based upon the selection in the combo box.
    If comboPaperSize.SelectedIndex <> -1 Then
        printDoc.DefaultPageSettings.PaperSize = _
        printDoc.PrinterSettings.PaperSizes.Item(comboPaperSize.SelectedIndex)
    End If

    ' Set the paper source based upon the selection in the combo box.
    If comboPaperSource.SelectedIndex <> -1 Then
        printDoc.DefaultPageSettings.PaperSource = _
        printDoc.PrinterSettings.PaperSources.Item(comboPaperSource.SelectedIndex)
    End If

    ' Set the printer resolution based upon the selection in the combo
 box.
    If comboPrintResolution.SelectedIndex <> -1 Then
        printDoc.DefaultPageSettings.PrinterResolution = _
        printDoc.PrinterSettings.PrinterResolutions.Item(comboPrintResolution.SelectedIndex)
    End If

    ' Print the document with the specified paper size and source.
    printDoc.Print()

End Sub
private void MyButtonPrint_Click(object sender,
 System.EventArgs e)
{
    // Set the paper size based upon the selection in the combo box.
    if (comboPaperSize.SelectedIndex != -1) {
        printDoc.DefaultPageSettings.PaperSize = 
            printDoc.PrinterSettings.PaperSizes[comboPaperSize.SelectedIndex];
    }

    // Set the paper source based upon the selection in the combo box.
    if (comboPaperSource.SelectedIndex != -1) {
        printDoc.DefaultPageSettings.PaperSource = 
            printDoc.PrinterSettings.PaperSources[comboPaperSource.SelectedIndex];
    }
    
    // Set the printer resolution based upon the selection in the combo
 box.
    if (comboPrintResolution.SelectedIndex != -1) 
    {
        printDoc.DefaultPageSettings.PrinterResolution= 
            printDoc.PrinterSettings.PrinterResolutions[comboPrintResolution.SelectedIndex];
    }

    // Print the document with the specified paper size, source, and
 print resolution.
    printDoc.Print();
}
private:
   void MyButtonPrint_Click( Object^ sender, System::EventArgs^
 e )
   {
      // Set the paper size based upon the selection in the combo box.
      if ( comboPaperSize->SelectedIndex != -1 )
      {
         printDoc->DefaultPageSettings->PaperSize = printDoc->PrinterSettings->PaperSizes[
 comboPaperSize->SelectedIndex ];
      }

      // Set the paper source based upon the selection in the combo
 box.
      if ( comboPaperSource->SelectedIndex != -1 )
      {
         printDoc->DefaultPageSettings->PaperSource = printDoc->PrinterSettings->PaperSources[
 comboPaperSource->SelectedIndex ];
      }

      // Set the printer resolution based upon the selection in the combo
 box.
      if ( comboPrintResolution->SelectedIndex != -1 )
      {
         printDoc->DefaultPageSettings->PrinterResolution = printDoc->PrinterSettings->PrinterResolutions[
 comboPrintResolution->SelectedIndex ];
      }

      // Print the document with the specified paper size, source, and
 print resolution.
      printDoc->Print();
   }
private void myButtonPrint_Click(Object sender,
 System.EventArgs e)
{
    // Set the paper size based upon the selection in the combo box.
    if (comboPaperSize.get_SelectedIndex() != -1) {
        printDoc.get_DefaultPageSettings().set_PaperSize(printDoc.
            get_PrinterSettings().get_PaperSizes().
            get_Item(comboPaperSize.get_SelectedIndex()));
    }
    // Set the paper source based upon the selection in the combo box.
    if (comboPaperSource.get_SelectedIndex() != -1) {
        printDoc.get_DefaultPageSettings().set_PaperSource(printDoc.
            get_PrinterSettings().get_PaperSources().
            get_Item(comboPaperSource.get_SelectedIndex()));
    }
    // Set the printer resolution based upon the selection in the combo
 box.
    if (comboPrintResolution.get_SelectedIndex() != -1) {
        printDoc.get_DefaultPageSettings().set_PrinterResolution(printDoc.
            get_PrinterSettings().get_PrinterResolutions().
            get_Item(comboPrintResolution.get_SelectedIndex()));
    }
    // Print the document with the specified paper size, source,
    // and print resolution.
    printDoc.Print();
} //myButtonPrint_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PageSettings クラス
PageSettings メンバ
System.Drawing.Printing 名前空間
PaperSource
PaperSource.Kind
PaperSourceKind
PrinterSettings.PaperSources



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

辞書ショートカット

すべての辞書の索引

「PageSettings.PaperSource プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS