Size Конструкторы
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Перегрузки
| Имя | Описание |
|---|---|
| Size(Point) |
Инициализирует новый экземпляр Size структуры из указанной Point структуры. |
| Size(Int32, Int32) |
Инициализирует новый экземпляр Size структуры из указанных измерений. |
Size(Point)
- Исходный код:
- Size.cs
- Исходный код:
- Size.cs
- Исходный код:
- Size.cs
- Исходный код:
- Size.cs
- Исходный код:
- Size.cs
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)
Параметры
Применяется к
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)
Параметры
Примеры
В следующем примере кода показано, как использовать Point.Point конструкторы и Size перечисление System.Drawing.ContentAlignment . Чтобы запустить этот пример, вставьте этот код в форму Windows, содержащую метку с именем Label1 и вызовите метод 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