Size コンストラクター

定義

指定したSizeからPoint構造体の新しいインスタンスを初期化します。

オーバーロード

名前 説明
Size(Point)

指定したSize構造体からPoint構造体の新しいインスタンスを初期化します。

Size(Int32, Int32)

指定したディメンションから Size 構造体の新しいインスタンスを初期化します。

Size(Point)

ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs

指定したSize構造体からPoint構造体の新しいインスタンスを初期化します。

public:
 Size(System::Drawing::Point pt);
public Size(System.Drawing.Point pt);
new System.Drawing.Size : System.Drawing.Point -> System.Drawing.Size
Public Sub New (pt As Point)

パラメーター

pt
Point

このPoint構造体の初期化元となるSize構造体。

適用対象

Size(Int32, Int32)

ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs
ソース:
Size.cs

指定したディメンションから Size 構造体の新しいインスタンスを初期化します。

public:
 Size(int width, int height);
public Size(int width, int height);
new System.Drawing.Size : int * int -> System.Drawing.Size
Public Sub New (width As Integer, height As Integer)

パラメーター

width
Int32

新しい Sizeの幅コンポーネント。

height
Int32

新しい Sizeの高さコンポーネント。

次のコード例では、 Point.Point コンストラクターと Size コンストラクター、および System.Drawing.ContentAlignment 列挙型を使用する方法を示します。 この例を実行するには、このコードを Label1 という名前のラベルを含むWindows フォームに貼り付け、フォームのコンストラクターで InitializeLabel1 メソッドを呼び出します。

void InitializeLabel1()
{
   // Set a border.
   Label1->BorderStyle = BorderStyle::FixedSingle;
   
   // Set the size, constructing a size from two integers.
   Label1->Size = System::Drawing::Size( 100, 50 );
   
   // Set the location, constructing a point from a 32-bit integer
   // (using hexadecimal).
   Label1->Location = Point(0x280028);
   
   // Set and align the text on the lower-right side of the label.
   Label1->TextAlign = ContentAlignment::BottomRight;
   Label1->Text = "Bottom Right Alignment";
}
private void InitializeLabel1()
{
    // Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle;

    // Set the size, constructing a size from two integers.
    Label1.Size = new Size(100, 50);

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    Label1.Location = new Point(0x280028);

    // Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight;
    Label1.Text = "Bottom Right Alignment";
}
Private Sub InitializeLabel1()

    ' Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle

    ' Set the size, constructing a size from two integers.
    Label1.Size = New Size(100, 50)

    ' Set the location, constructing a point from a 32-bit integer
    ' (using hexadecimal).
    Label1.Location = New Point(&H280028)

    ' Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight
    Label1.Text = "Bottom Right Alignment"
End Sub

適用対象