Size Oluşturucular

Tanım

Belirtilen Sizesürümünden Point yapının yeni bir örneğini başlatır.

Aşırı Yüklemeler

Name Description
Size(Point)

Belirtilen Size yapıdan yapının yeni bir örneğini Point başlatır.

Size(Int32, Int32)

Belirtilen boyutlardan Size yapının yeni bir örneğini başlatır.

Size(Point)

Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs

Belirtilen Size yapıdan yapının yeni bir örneğini Point başlatır.

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)

Parametreler

pt
Point

Bu PointSize yapının başlatıldığı yapı.

Şunlara uygulanır

Size(Int32, Int32)

Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs
Kaynak:
Size.cs

Belirtilen boyutlardan Size yapının yeni bir örneğini başlatır.

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)

Parametreler

width
Int32

Yeni Sizeöğesinin genişlik bileşeni.

height
Int32

Yeni Sizeöğesinin yükseklik bileşeni.

Örnekler

Aşağıdaki kod örneği, ve Point.Point oluşturucularının ve numaralandırmasının Size nasıl kullanılacağını System.Drawing.ContentAlignment gösterir. Bu örneği çalıştırmak için, bu kodu Label1 adlı etiketi içeren bir Windows Formuna yapıştırın ve formun oluşturucusunda InitializeLabel1 yöntemini çağırın.

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

Şunlara uygulanır