Point-Konstruktor (Int32)
Initialisiert eine neue Instanz der Point-Klasse unter Verwendung von als Ganzzahlwert angegebenen Koordinaten.
Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)
Syntax
'Declaration
Public Sub New ( _
dw As Integer _
)
'Usage
Dim dw As Integer
Dim instance As New Point(dw)
public Point (
int dw
)
public:
Point (
int dw
)
public Point (
int dw
)
public function Point (
dw : int
)
Parameter
- dw
Eine 32-Bit-Ganzzahl, die die Koordinaten für den neuen Point angibt.
Hinweise
Die niederwertigen 16 Bits des dw-Parameters geben die horizontale x-Koordinate und die hochwertigen 16 Bits die vertikale y-Koordinate für den neuen Point an.
Beispiel
Im folgenden Codebeispiel wird die Verwendung des Point-Konstruktors und des System.Drawing.Size-Konstruktors sowie der System.Drawing.ContentAlignment-Enumeration veranschaulicht. Fügen Sie zum Ausführen dieses Beispiels diesen Code in ein Windows Form ein, das die Bezeichnung Label1
enthält, und rufen Sie die IntializeLabel1
-Methode im Konstruktor des Formulars auf.
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
Plattformen
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 unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0