PaperSource.SourceName Propiedad

Definición

Obtiene o establece el nombre del origen del papel.

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

Valor de propiedad

El nombre del origen de papel.

Ejemplos

En el ejemplo de código siguiente se rellena el comboPaperSource cuadro combinado con los orígenes de papel admitidos de la impresora. SourceName se identifica como la propiedad que proporciona la cadena de presentación para el elemento que se agrega a través de la DisplayMember propiedad del cuadro combinado. El ejemplo requiere que exista una PrintDocument variable denominada printDoc y que exista el cuadro combinado específico.

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

Comentarios

Llame a esta propiedad cuando se deba mostrar el origen del papel. El nombre del origen del papel se genera en función de la Kind propiedad .

Se aplica a

Consulte también