Share via


PrinterSettings.PaperSourceCollection.Count Proprietà

Definizione

Ottiene il numero di diversi cassetti di alimentazione della carta nell'insieme.

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

Valore della proprietà

Numero di diversi cassetti di alimentazione della carta nell'insieme.

Implementazioni

Esempio

Nell'esempio di codice seguente viene popolata la comboPaperSource casella combinata con le origini di carta supportate dalla stampante. L'oggetto SourceName viene identificato come proprietà che fornisce la stringa di visualizzazione per l'elemento aggiunto tramite la DisplayMember proprietà della casella combinata. L'esempio richiede che esista una PrintDocument variabile denominata printDoc e che esista la casella combinata specifica.

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

Si applica a