PrinterSettings.PaperSizes 속성

정의

이 프린터에서 지 원하는 용지 크기를 가져옵니다.Gets the paper sizes that are supported by this printer.

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

속성 값

이 프린터에서 지원하는 용지 크기를 나타내는 PrinterSettings.PaperSizeCollection입니다.A PrinterSettings.PaperSizeCollection that represents the paper sizes that are supported by this printer.

예제

다음 코드 예제에서는 comboPaperSize 콤보 상자를 프린터의 지원 되는 용지 크기로 채웁니다.The following code example populates the comboPaperSize combo box with the printer's supported paper sizes. 또한 사용자 지정 용지 크기를 만들어지고 콤보 상자에 추가 됩니다.In addition, a custom paper size is created and added to the combo box. PaperName은 콤보 상자의 DisplayMember 속성을 통해 추가 되는 항목에 대 한 표시 문자열을 제공 하는 속성으로 식별 됩니다.The PaperName is identified as the property that provides the display string for the item being added through the DisplayMember property of the combo box. 이 예에서는 printDoc 이라는 PrintDocument 변수가 있고 특정 콤보 상자가 있어야 합니다.The example requires that a PrintDocument variable named printDoc exists and that the specific combo box exists.

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

설명

PrinterSettings.PaperSizeCollectionPaperKind 값 중 하나를 포함 하는 PaperSize.Kind 속성을 통해 용지 크기를 나타내는 PaperSize 인스턴스를 포함 합니다.The PrinterSettings.PaperSizeCollection contains PaperSize instances that represent the paper sizes through the PaperSize.Kind property, which contains one of the PaperKind values.

일반적으로 PageSettings.PaperSize 속성을 통해 페이지의 용지 크기를 PaperSizes 컬렉션을 통해 사용할 수 있는 유효한 PaperSize로 설정 합니다.Typically, you set a page's paper size through the PageSettings.PaperSize property to a valid PaperSize available through the PaperSizes collection.

사용자 지정 용지 크기를 지정 하려면 PaperSize 생성자를 참조 하세요.To specify a custom paper size, see the PaperSize constructor.

적용 대상

추가 정보