Бөлісу құралы:


PrinterSettings.PaperSources Свойство

Определение

Возвращает исходные лотки бумаги, доступные на принтере.

public:
 property System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ PaperSources { System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ get(); };
public System.Drawing.Printing.PrinterSettings.PaperSourceCollection PaperSources { get; }
member this.PaperSources : System.Drawing.Printing.PrinterSettings.PaperSourceCollection
Public ReadOnly Property PaperSources As PrinterSettings.PaperSourceCollection

Значение свойства

Объект, PrinterSettings.PaperSourceCollection представляющий лотки источника бумаги, доступные на этом принтере.

Примеры

Следующий пример кода заполняет comboPaperSource поле со списком поддерживаемыми источниками бумаги принтера. Определяется SourceName как свойство, которое предоставляет отображаемую строку для добавляемого элемента через DisplayMember свойство поля со списком. В примере требуется, чтобы PrintDocument переменная printDoc существовала и что существует конкретное поле со списком.

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

Комментарии

Содержит PrinterSettings.PaperSourceCollection экземпляры, представляющие области источника бумаги через PaperSource.Kind свойство, которое содержит одно из значенийPaperSourceKind.PaperSource

Как правило, вы задаете источник бумаги страницы через PageSettings.PaperSource свойство допустимым PaperSource доступным через коллекцию PaperSources .

Применяется к

См. также раздел