PrinterSettings.PaperSourceCollection.Item[Int32] 속성

정의

지정된 인덱스에 해당하는 PaperSource을 가져옵니다.

public:
 virtual property System::Drawing::Printing::PaperSource ^ default[int] { System::Drawing::Printing::PaperSource ^ get(int index); };
public virtual System.Drawing.Printing.PaperSource this[int index] { get; }
member this.Item(int) : System.Drawing.Printing.PaperSource
Default Public Overridable ReadOnly Property Item(index As Integer) As PaperSource

매개 변수

index
Int32

가져올 PaperSource 의 인덱스입니다.

속성 값

지정한 인덱스에 있는 PaperSource입니다.

예제

다음 코드 예제에서는 프린터의 comboPaperSource 지원되는 용지 원본으로 콤보 상자를 채웁니다. SourceName 은 콤보 상자의 속성을 통해 추가되는 항목에 대한 표시 문자열을 DisplayMember 제공하는 속성으로 식별됩니다. 이 예제에서는 라는 printDoc 변수가 PrintDocument 있고 특정 콤보 상자가 있어야 합니다.

// 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

적용 대상

추가 정보