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 .