PaperSize コンストラクター
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
PaperSize クラスの新しいインスタンスを初期化します。
オーバーロード
| 名前 | 説明 |
|---|---|
| PaperSize() |
PaperSize クラスの新しいインスタンスを初期化します。 |
| PaperSize(String, Int32, Int32) |
PaperSize クラスの新しいインスタンスを初期化します。 |
注釈
次の表に、 PaperSize クラスのインスタンスの初期プロパティ値を示します。
| 財産 | 初期値 |
|---|---|
| Kind | PaperKind.Custom |
| PaperName | String.Empty |
PaperSize()
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
PaperSize クラスの新しいインスタンスを初期化します。
public:
PaperSize();
public PaperSize();
Public Sub New ()
適用対象
PaperSize(String, Int32, Int32)
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
- ソース:
- PaperSize.cs
PaperSize クラスの新しいインスタンスを初期化します。
public:
PaperSize(System::String ^ name, int width, int height);
public PaperSize(string name, int width, int height);
new System.Drawing.Printing.PaperSize : string * int * int -> System.Drawing.Printing.PaperSize
Public Sub New (name As String, width As Integer, height As Integer)
パラメーター
- name
- String
用紙の名前。
- width
- Int32
用紙の幅を 100 分の 1 インチ単位で指定します。
- height
- Int32
用紙の高さ (100 分の 1 インチ)。
例
次のコード例では、 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)
注釈
このコンストラクターを使用して作成された PaperSize は、常に Kind プロパティを Custom に設定します。 WidthおよびHeightプロパティの値は、カスタム PaperSize オブジェクトに対してのみ設定できます。