PaperSource.SourceName 속성

정의

용지 공급의 이름을 가져오거나 설정합니다.

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

속성 값

용지 공급의 이름입니다.

예제

다음 코드 예제에서는 comboPaperSource 프린터의 지원되는 용지 원본으로 콤보 상자를 채웁니다. 는 SourceName 콤보 상자의 속성을 통해 추가되는 항목에 대한 표시 문자열을 DisplayMember 제공하는 속성으로 식별됩니다. 이 예제에서는 라는 printDoc 변수가 PrintDocument 있고 특정 콤보 상자가 있어야 합니다.

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

설명

용지 원본을 표시해야 하는 경우 이 속성을 호출합니다. 용지 원본의 이름은 속성에 따라 Kind 생성됩니다.

적용 대상

추가 정보