PrinterSettings.PaperSources プロパティ

定義

プリンターで使用できる用紙トレイを取得します。

public:
 property System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ PaperSources { System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ get(); };
public System.Drawing.Printing.PrinterSettings.PaperSourceCollection PaperSources { get; }
member this.PaperSources : System.Drawing.Printing.PrinterSettings.PaperSourceCollection
Public ReadOnly Property PaperSources As PrinterSettings.PaperSourceCollection

プロパティ値

プリンターで使用できる用紙トレイを表す PrinterSettings.PaperSourceCollection

次のコード例では、コンボ ボックスに comboPaperSource プリンターでサポートされている用紙ソースを設定します。 SourceNameは、コンボ ボックスの プロパティを介して追加される項目の表示文字列をDisplayMember提供する プロパティとして識別されます。 この例では、 という名前printDocPrintDocument変数が存在し、特定のコンボ ボックスが存在する必要があります。

// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSource->DisplayMember = "SourceName";
PaperSource^ pkSource;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSources->Count; i++ )
{
   pkSource = printDoc->PrinterSettings->PaperSources[ i ];
   comboPaperSource->Items->Add( pkSource );
}
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember="SourceName";

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
    pkSource = printDoc.PrinterSettings.PaperSources[i];
    comboPaperSource.Items.Add(pkSource);
}
' Add list of paper sources found on the printer to the combo box.
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember = "SourceName"

Dim pkSource As PaperSource
For i = 0 to printDoc.PrinterSettings.PaperSources.Count - 1
    pkSource = printDoc.PrinterSettings.PaperSources.Item(i)
    comboPaperSource.Items.Add(pkSource)
Next

注釈

PrinterSettings.PaperSourceCollectionには、 PaperSource プロパティを介してPaperSource.Kind用紙ソース トレイを表すインスタンスが含まれます。このインスタンスには、値の PaperSourceKind 1 つが含まれています。

通常、 プロパティを使用してページの用紙ソースを、コレクションからPageSettings.PaperSource使用可能PaperSourcesな有効な PaperSource に設定します。

適用対象

こちらもご覧ください