PaperSource.SourceName Propriété

Définition

Obtient ou définit le nom de la source de papier.

public:
 property System::String ^ SourceName { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ SourceName { System::String ^ get(); };
public string SourceName { get; set; }
public string SourceName { get; }
member this.SourceName : string with get, set
member this.SourceName : string
Public Property SourceName As String
Public ReadOnly Property SourceName As String

Valeur de propriété

Nom de l'alimentation papier.

Exemples

L’exemple de code suivant remplit la comboPaperSource zone de liste modifiable avec les sources de papier prises en charge de l’imprimante. est SourceName identifié comme la propriété qui fournit la chaîne d’affichage de l’élément ajouté par le biais de la DisplayMember propriété de la zone de liste déroulante. L’exemple exige qu’une PrintDocument variable nommée printDoc existe et que la zone de liste modifiable spécifique existe.

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

Remarques

Appelez cette propriété lorsque la source de papier doit être affichée. Le nom de la source de papier est généré en fonction de la Kind propriété .

S’applique à

Voir aussi