PaperSource.SourceName Propriedade
Definição
Obtém ou define o nome da fonte de papel.Gets or sets the name of the paper source.
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 da propriedade
O nome da fonte de papel.The name of the paper source.
Exemplos
O exemplo de código a seguir popula a comboPaperSource caixa de combinação com as fontes de papel com suporte da impressora.The following code example populates the comboPaperSource combo box with the printer's supported paper sources. O SourceName é identificado como a propriedade que fornece a cadeia de caracteres de exibição para o item que está sendo adicionado por meio da DisplayMember propriedade da caixa de combinação.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. O exemplo requer que uma PrintDocument variável nomeada printDoc exista e que a caixa de combinação específica exista.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
Comentários
Chame essa propriedade quando a origem do papel precisar ser exibida.Call this property when the paper source needs to be displayed. O nome da fonte do papel é gerado com base na Kind propriedade.The name of the paper source is generated based upon the Kind property.