PrinterSettings.PaperSourceCollection.Count PrinterSettings.PaperSourceCollection.Count PrinterSettings.PaperSourceCollection.Count PrinterSettings.PaperSourceCollection.Count Property

Определение

Получает число разных источников бумаги в коллекции.Gets the number of different paper sources in the collection.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Значение свойства

Число разных источников бумаги в коллекции.The number of different paper sources in the collection.

Реализации

Примеры

Следующий пример кода заполняет comboPaperSource поддерживаемых поле со списком с принтером источники бумаги.The following code example populates the comboPaperSource combo box with the printer's supported paper sources. SourceName Определяется как свойства, которое предоставляет отображаемую строку для элемента, добавленного при помощи DisplayMember поля со списком.The SourceName is identified as the property that provides the display string for the item being added through the DisplayMember property of the combo box. В этом примере требуется PrintDocument переменную с именем printDoc существует и что существует поле со списком конкретных.The example requires that a PrintDocument variable named printDoc exists and that the specific combo box exists.

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

Применяется к