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 CheckBox-Klasse.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Sub New
'Usage
Dim instance As New CheckBox
public CheckBox ()
public:
CheckBox ()
public CheckBox ()
public function CheckBox ()
Hinweise
Wenn eine neue CheckBox instanziiert wird, wird AutoCheck standardmäßig auf true, Checked auf false und Appearance auf Normal festgelegt.
Beispiel
Im folgenden Beispiel wird eine CheckBox erstellt und initialisiert. Diese wird als Umschaltfläche dargestellt, der Wert für AutoCheck wird auf false festgelegt, und sie wird einem Form hinzugefügt.
Public Sub InstantiateMyCheckBox()
' Create and initialize a CheckBox.
Dim checkBox1 As New CheckBox()
' Make the check box control appear as a toggle button.
checkBox1.Appearance = Appearance.Button
' Turn off the update of the display on the click of the control.
checkBox1.AutoCheck = False
' Add the check box control to the form.
Controls.Add(checkBox1)
End Sub 'InstantiateMyCheckBox
public void InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
CheckBox checkBox1 = new CheckBox();
// Make the check box control appear as a toggle button.
checkBox1.Appearance = Appearance.Button;
// Turn off the update of the display on the click of the control.
checkBox1.AutoCheck = false;
// Add the check box control to the form.
Controls.Add(checkBox1);
}
public:
void InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
CheckBox^ checkBox1 = gcnew CheckBox;
// Make the check box control appear as a toggle button.
checkBox1->Appearance = Appearance::Button;
// Turn off the update of the display on the click of the control.
checkBox1->AutoCheck = false;
// Add the check box control to the form.
this->Controls->Add( checkBox1 );
}
public void InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
CheckBox checkBox1 = new CheckBox();
// Make the check box control appear as a toggle button.
checkBox1.set_Appearance(Appearance.Button);
// Turn off the update of the display on the click of the control.
checkBox1.set_AutoCheck(false);
// Add the check box control to the form.
get_Controls().Add(checkBox1);
} //InstantiateMyCheckBox
public function InstantiateMyCheckBox()
{
// Create and initialize a CheckBox.
var checkBox1 : CheckBox = new CheckBox();
// Make the check box control appear as a toggle button.
checkBox1.Appearance = Appearance.Button;
// Turn off the update of the display on the click of the control.
checkBox1.AutoCheck = false;
// Add the check box control to the form.
Controls.Add(checkBox1);
}
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
.NET Compact Framework
Unterstützt in: 2.0, 1.0
Siehe auch
Referenz
CheckBox-Klasse
CheckBox-Member
System.Windows.Forms-Namespace
CheckBox-Klasse