Size コンストラクター

定義

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

オーバーロード

Size(Point)

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

Size(Int32, Int32)

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

Size(Point)

ソース:
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 構造体の新しいインスタンスを初期化します。

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 の高さコンポーネント。

次のコード例では、 および コンストラクターと Size 列挙体をPoint.Point使用する方法を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

適用対象