Size コンストラクタ (Point)
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Size コンストラクタ (Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
使用例
System.Drawing.Point コンストラクタと Size コンストラクタ、および System.Drawing.ContentAlignment 列挙体の使用方法を示すコード例を次に示します。この例を実行するには、Label1 という名前のラベルが配置された Windows フォームにコードを貼り付け、フォームのコンストラクタで IntializeLabel1 メソッドを呼び出します。
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
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"; }
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.set_BorderStyle(BorderStyle.FixedSingle); // Set the size, constructing a size from two integers. label1.set_Size(new Size(100, 50)); // Set the location, constructing a point from a 32-bit integer // (using hexadecimal). label1.set_Location(new Point(0x280028)); // Set and align the text on the lower-right side of the label. label1.set_TextAlign(ContentAlignment.BottomRight); label1.set_Text("Bottom Right Alignment"); } //Initializelabel1
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Size コンストラクタ
- Size コンストラクタのページへのリンク