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.
Initialisiert eine neue Instanz der GroupBox-Klasse.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Sub New
'Usage
Dim instance As New GroupBox
public GroupBox ()
public:
GroupBox ()
public GroupBox ()
public function GroupBox ()
Hinweise
Beim Erstellen einer neuen GroupBox ist die TabStop-Eigenschaft standardmäßig auf false festgelegt. Das Gruppenfeld hat eine Standardhöhe von 100 Pixel und eine Standardbreite von 200 Pixel.
Beispiel
Im folgenden Codebeispiel werden ein GroupBox-Steuerelement und zwei RadioButton-Steuerelemente instanziiert und erstellt. Die Optionsfelder (auch als Optionsschaltflächen bezeichnet) werden dem Gruppenfeld hinzugefügt, und das Gruppenfeld wird dem Form hinzugefügt.
Private Sub InitializeMyGroupBox()
' Create and initialize a GroupBox and two RadioButton controls.
Dim groupBox1 As New GroupBox()
Dim radioButton1 As New RadioButton()
Dim radioButton2 As New RadioButton()
' Set the FlatStyle of the GroupBox.
groupBox1.FlatStyle = FlatStyle.System
' Add the RadioButtons to the GroupBox.
groupBox1.Controls.Add(radioButton1)
groupBox1.Controls.Add(radioButton2)
' Add the GroupBox to the Form.
Controls.Add(groupBox1)
End Sub 'InitializeMyGroupBox
private void InitializeMyGroupBox()
{
// Create and initialize a GroupBox and two RadioButton controls.
GroupBox groupBox1 = new GroupBox();
RadioButton radioButton1 = new RadioButton();
RadioButton radioButton2 = new RadioButton();
// Set the FlatStyle of the GroupBox.
groupBox1.FlatStyle = FlatStyle.System;
// Add the RadioButtons to the GroupBox.
groupBox1.Controls.Add(radioButton1);
groupBox1.Controls.Add(radioButton2);
// Add the GroupBox to the Form.
Controls.Add(groupBox1);
}
private:
void InitializeMyGroupBox()
{
// Create and initialize a GroupBox and two RadioButton controls.
GroupBox^ groupBox1 = gcnew GroupBox;
RadioButton^ radioButton1 = gcnew RadioButton;
RadioButton^ radioButton2 = gcnew RadioButton;
// Add the RadioButtons to the GroupBox.
groupBox1->Controls->Add( radioButton1 );
groupBox1->Controls->Add( radioButton2 );
// Add the GroupBox to the Form.
Controls->Add( groupBox1 );
}
private void InitializeMyGroupBox()
{
// Create and initialize a GroupBox and two RadioButton controls.
GroupBox groupBox1 = new GroupBox();
RadioButton radioButton1 = new RadioButton();
RadioButton radioButton2 = new RadioButton();
// Set the FlatStyle of the GroupBox.
groupBox1.set_FlatStyle(FlatStyle.System);
// Add the RadioButtons to the GroupBox.
groupBox1.get_Controls().Add(radioButton1);
groupBox1.get_Controls().Add(radioButton2);
// Add the GroupBox to the Form.
get_Controls().Add(groupBox1);
} //InitializeMyGroupBox
function InitializeMyGroupBox(){
// Create and initialize a GroupBox and two RadioButton controls.
var groupBox1 : GroupBox = new GroupBox()
var radioButton1 : RadioButton = new RadioButton()
var radioButton2 : RadioButton = new RadioButton()
// Set the FlatStyle of the GroupBox.
groupBox1.FlatStyle = FlatStyle.System
// Add the RadioButtons to the GroupBox.
groupBox1.Controls.Add(radioButton1)
groupBox1.Controls.Add(radioButton2)
// Add the GroupBox to the Form.
Controls.Add(groupBox1)
}
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, 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
Siehe auch
Referenz
GroupBox-Klasse
GroupBox-Member
System.Windows.Forms-Namespace