PrinterSettings.PaperSizes Özellik

Tanım

Bu yazıcı tarafından desteklenen kağıt boyutlarını alır.

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

Özellik Değeri

PrinterSettings.PaperSizeCollection Bu yazıcı tarafından desteklenen kağıt boyutlarını temsil eden bir.

Örnekler

Aşağıdaki kod örneği, birleşik giriş kutusunu yazıcının desteklenen kağıt boyutlarıyla doldurur comboPaperSize . Buna ek olarak, özel bir kağıt boyutu oluşturulur ve birleşik giriş kutusuna eklenir. PaperName, birleşik giriş kutusunun özelliği aracılığıyla DisplayMember eklenen öğe için görüntü dizesi sağlayan özellik olarak tanımlanır. Örnek, adlı printDoc bir değişkenin mevcut olmasını ve belirli bir PrintDocument birleşik giriş kutusunun mevcut olmasını gerektirir.

// Add list of supported paper sizes found on the printer.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSize->DisplayMember = "PaperName";
PaperSize^ pkSize;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSizes->Count; i++ )
{
   pkSize = printDoc->PrinterSettings->PaperSizes[ i ];
   comboPaperSize->Items->Add( pkSize );
}

// Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
PaperSize^ pkCustomSize1 = gcnew PaperSize( "First custom size",100,200 );
comboPaperSize->Items->Add( pkCustomSize1 );
// Add list of supported paper sizes found on the printer. 
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSize.DisplayMember = "PaperName";

PaperSize pkSize;
for (int i = 0; i < printDoc.PrinterSettings.PaperSizes.Count; i++){
    pkSize = printDoc.PrinterSettings.PaperSizes[i];
    comboPaperSize.Items.Add(pkSize);
}

// Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
PaperSize pkCustomSize1 = new PaperSize("First custom size", 100, 200);

comboPaperSize.Items.Add(pkCustomSize1);
' Add list of supported paper sizes found on the printer. 
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSize.DisplayMember = "PaperName"

Dim pkSize As PaperSize
For i = 0 to printDoc.PrinterSettings.PaperSizes.Count - 1
    pkSize = printDoc.PrinterSettings.PaperSizes.Item(i)
    comboPaperSize.Items.Add(pkSize)
Next

' Create a PaperSize and specify the custom paper size through the constructor and add to combobox.
Dim pkCustomSize1 As New PaperSize("Custom Paper Size", 100, 200)

comboPaperSize.Items.Add(pkCustomSize1)

Açıklamalar

özelliği PrinterSettings.PaperSizeCollection aracılığıyla PaperSize.Kind kağıt boyutlarını temsil eden örnekler içerir PaperSize ve bu da değerlerden birini PaperKind içerir.

Genellikle, özelliği aracılığıyla bir sayfanın kağıt boyutunu koleksiyon aracılığıyla PageSettings.PaperSizePaperSizes kullanılabilen geçerli PaperSize bir değere ayarlarsınız.

Özel bir kağıt boyutu belirtmek için oluşturucuya PaperSize bakın.

Şunlara uygulanır

Ayrıca bkz.