PaperSize クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
用紙のサイズを指定します。
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提供する プロパティとして識別されます。 この例では、 という名前printDoc
のPrintDocument変数が存在し、特定のコンボ ボックスが存在することを前提としています。
// 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)
このクラスは、 プロパティと PageSettings.PaperSize プロパティによってPrinterSettings.PaperSizes使用され、プリンターで使用できる用紙サイズを取得し、ページの用紙サイズをそれぞれ設定します。
コンストラクターを PaperSize 使用して、カスタム用紙サイズを指定できます。 プロパティと Height プロパティの値はWidth、カスタム PaperSize オブジェクトに対してのみ設定できます。
印刷の詳細については、名前空間の概要に関するページを System.Drawing.Printing 参照してください。
Paper |
PaperSize クラスの新しいインスタンスを初期化します。 |
Paper |
PaperSize クラスの新しいインスタンスを初期化します。 |
Height |
用紙の縦幅を 1/100 インチ単位で取得または設定します。 |
Kind |
用紙の種類を取得します。 |
Paper |
用紙の種類名を取得または設定します。 |
Raw |
PaperSize 値のいずれか、またはカスタム値を表す整数を取得または設定します。 |
Width |
用紙の横幅を 1/100 インチ単位で取得または設定します。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
Get |
既定のハッシュ関数として機能します。 (継承元 Object) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
To |
PaperSize に関する情報を文字列形式で提供します。 |
製品 | バージョン |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。