CheckBox.AutoCheck Propiedad
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece un valor que indica si los valores de Checked o CheckState y la apariencia de CheckBox cambian automáticamente al hacer clic en dicha casilla CheckBox.
public:
property bool AutoCheck { bool get(); void set(bool value); };
public bool AutoCheck { get; set; }
member this.AutoCheck : bool with get, set
Public Property AutoCheck As Boolean
true
si el valor de Checked o CheckState y la apariencia del control cambian automáticamente en el evento Click; en cualquier otro caso, false
. El valor predeterminado es true
.
En el ejemplo de código siguiente se crea e inicializa un CheckBoxelemento , se le da la apariencia de un botón de alternancia, se establece AutoCheckfalse
en y se agrega a .Form
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.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 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
Si AutoCheck se establece en false, deberá agregar código para actualizar los Checked valores o CheckState en el Click controlador de eventos.
Producto | Versiones |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: