Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Ruft den Rahmentyp des Textfeld-Steuerelements ab oder legt diesen fest.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Property BorderStyle As BorderStyle
'Usage
Dim instance As TextBoxBase
Dim value As BorderStyle
value = instance.BorderStyle
instance.BorderStyle = value
public BorderStyle BorderStyle { get; set; }
public:
property BorderStyle BorderStyle {
BorderStyle get ();
void set (BorderStyle value);
}
/** @property */
public BorderStyle get_BorderStyle ()
/** @property */
public void set_BorderStyle (BorderStyle value)
public function get BorderStyle () : BorderStyle
public function set BorderStyle (value : BorderStyle)
Eigenschaftenwert
Ein BorderStyle, der den Rahmentyp des Textfeld-Steuerelements darstellt. Der Standardwert ist Fixed3D.
Ausnahmen
| Ausnahmetyp | Bedingung |
|---|---|
Der Eigenschaft wurde ein Wert außerhalb des gültigen Wertebereichs der Enumeration zugewiesen. |
Hinweise
Mit der BorderStyle-Eigenschaft können Sie zusätzlich zum vorgegebenen dreidimensionalen Steuerelement flache oder rahmenlose Steuerelemente erstellen.
Hinweis
Die abgeleitete Klasse RichTextBox unterstützt das BorderStyle.FixedSingle-Format nicht. Dieses Format bewirkt, dass als BorderStyle stattdessen das BorderStyle.Fixed3D-Format verwendet wird.
Beispiel
Im folgenden Codebeispiel wird mit der abgeleiteten Klasse TextBox ein Textfeld erstellt, in dem Text mit der Schriftart Arial, der Schriftgröße 20 Punkt und einem einfachen Rahmen korrekt angezeigt werden kann. In diesem Beispiel wird mithilfe der PreferredHeight-Eigenschaft die angemessene Größe des Steuerelements bestimmt, nachdem dem Steuerelement Schriftart und BorderStyle zugewiesen wurden.
Public Sub CreateTextBox()
' Create an instance of the TextBox control.
Dim textBox1 As New TextBox()
' Set the TextBox Font property to Arial 20.
textBox1.Font = New Font("Arial", 20)
' Set the BorderStyle property to FixedSingle.
textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
' Make the height of the control equal to the preferred height.
textBox1.Height = textBox1.PreferredHeight
End Sub
public void CreateTextBox()
{
// Create an instance of the TextBox control.
TextBox textBox1 = new TextBox();
// Set the TextBox Font property to Arial 20.
textBox1.Font = new Font ("Arial" , 20);
// Set the BorderStyle property to FixedSingle.
textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
// Make the height of the control equal to the preferred height.
textBox1.Height = textBox1.PreferredHeight;
}
public:
void CreateTextBox()
{
// Create an instance of the TextBox control.
TextBox^ textBox1 = gcnew TextBox;
// Set the TextBox Font property to Arial 20.
textBox1->Font = gcnew System::Drawing::Font( "Arial", 20 );
// Set the BorderStyle property to FixedSingle.
textBox1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
// Make the height of the control equal to the preferred height.
textBox1->Height = textBox1->PreferredHeight;
}
public void CreateTextBox()
{
// Create an instance of the TextBox control.
TextBox textBox1 = new TextBox();
// Set the TextBox Font property to Arial 20.
textBox1.set_Font(new Font("Arial", 20));
// Set the BorderStyle property to FixedSingle.
textBox1.set_BorderStyle(System.Windows.Forms.BorderStyle.FixedSingle);
// Make the height of the control equal to the preferred height.
textBox1.set_Height(textBox1.get_PreferredHeight());
} //CreateTextBox
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, 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
.NET Compact Framework
Unterstützt in: 2.0
Siehe auch
Referenz
TextBoxBase-Klasse
TextBoxBase-Member
System.Windows.Forms-Namespace