PaperSize コンストラクタ ()
アセンブリ: System.Drawing (system.drawing.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PaperSize コンストラクタ (String, Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim name As String Dim width As Integer Dim height As Integer Dim instance As New PaperSize(name, width, height)

このコンストラクタを使用して作成した PaperSize の Kind プロパティは、常に Custom に設定されます。Width プロパティと Height プロパティの値は、カスタムの 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" 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)
// 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"; 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.set_DisplayMember("PaperName"); PaperSize pkSize; for (int i = 0; i < printDoc.get_PrinterSettings().get_PaperSizes(). get_Count(); i++) { pkSize = printDoc.get_PrinterSettings().get_PaperSizes(). get_Item(i); comboPaperSize.get_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.get_Items().Add(pkCustomSize1);

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PaperSize コンストラクタ
- PaperSize コンストラクタ ()のページへのリンク
辞書ショートカット
カテゴリ一覧
すべての辞書の索引