PrinterSettings.PaperSourceCollection.Count Propriedade

Definição

Obtém o número de fontes em papel diferentes na coleção.

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

Valor de Propriedade

O número de fontes em papel diferentes na coleção.

Implementações

Exemplos

O exemplo de código seguinte preenche a comboPaperSource caixa combinada com as fontes de papel suportadas pela impressora. A SourceName é identificada como a propriedade que fornece a string de visualização para o item que está a ser adicionado através da DisplayMember propriedade da caixa combinada. O exemplo exige que exista uma PrintDocument variável nomeada printDoc e que exista a caixa de combo específica.

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

Aplica-se a