Share via


PaperSize.PaperName Özellik

Tanım

Kağıt türünün adını alır veya ayarlar.

public:
 property System::String ^ PaperName { System::String ^ get(); void set(System::String ^ value); };
public string PaperName { get; set; }
member this.PaperName : string with get, set
Public Property PaperName As String

Özellik Değeri

Kağıt türünün adı.

Özel durumlar

Kind özelliği olarak Customayarlanmadı.

Örnekler

Aşağıdaki kod örneği, birleşik giriş kutusunu yazıcının desteklenen kağıt boyutlarıyla doldurur comboPaperSize . PaperName, birleşik giriş kutusunun özelliği aracılığıyla DisplayMember eklenen öğe için görüntü dizesi sağlayacak özellik olarak tanımlanır. Örnekte adlı printDoc bir değişkenin mevcut olduğu ve belirli bir PrintDocument birleşik giriş kutusunun mevcut olduğu varsayılır.

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

Kağıt adını yalnızca özelliği olarak ayarlandıysa Kind ayarlayabilirsiniz Custom.

Şunlara uygulanır

Ayrıca bkz.