PaperSize 클래스

정의

용지 크기를 지정합니다.

public ref class PaperSize
public class PaperSize
[System.Serializable]
public class PaperSize
type PaperSize = class
[<System.Serializable>]
type PaperSize = class
Public Class PaperSize
상속
PaperSize
특성

예제

다음 코드 예제에서는 프린터의 comboPaperSize 지원되는 용지 크기로 콤보 상자를 채웁니다. 또한 사용자 지정 용지 크기가 만들어지고 콤보 상자에 추가됩니다. PaperName 콤보 상자의 속성을 통해 추가되는 항목에 대한 표시 문자열을 DisplayMember 제공하는 속성으로 식별됩니다. 이 예제에서는 명명 printDocPrintDocument 변수가 있고 특정 콤보 상자가 있다고 가정합니다.

// 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.PaperSizes PageSettings.PaperSize 사용할 수 있는 용지 크기를 가져오기 위해 사용 하 고 페이지에 대 한 용지 크기를 각각 설정 하는 속성입니다.

생성자를 사용하여 PaperSize 사용자 지정 용지 크기를 지정할 수 있습니다. 및 Height 속성 값은 Width 사용자 지정 PaperSize 개체에 대해서만 설정할 수 있습니다.

인쇄에 대한 자세한 내용은 네임스페이스 개요를 System.Drawing.Printing 참조하세요.

생성자

PaperSize()

PaperSize 클래스의 새 인스턴스를 초기화합니다.

PaperSize(String, Int32, Int32)

PaperSize 클래스의 새 인스턴스를 초기화합니다.

속성

Height

용지 높이(1/100인치)를 가져오거나 설정합니다.

Kind

용지 종류를 가져옵니다.

PaperName

용지 종류의 이름을 가져오거나 설정합니다.

RawKind

PaperSize 값 중 하나나 사용자 지정 값을 나타내는 정수를 가져오거나 설정합니다.

Width

용지 너비(1/100인치)를 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

PaperSize에 대한 정보를 문자열 형식으로 제공합니다.

적용 대상

추가 정보