ToggleButton.Checked Evento

Definición

Se produce cuando se activa ToggleButton.

C#
public event System.Windows.RoutedEventHandler Checked;

Tipo de evento

Ejemplos

En el ejemplo siguiente se cambia la suscripción a los Checked eventos y UncheckedEvent para cambiar el FontStyle de TextBlock, textBlock1.

XAML
<CheckBox Name="chkbox" Content="Italicize text"
          Checked="chkbox_Checked"
          Unchecked="chkbox_Unchecked"/>

<TextBlock Name="textBlock1" FontSize="14">
  The quick brown fox jumps over the lazy dog.
</TextBlock>
C#
void chkbox_Unchecked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Normal;
}

void chkbox_Checked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Italic;
}

Comentarios

Información sobre eventos enrutados

Campo identificador CheckedEvent
Estrategia de enrutamiento Burbujeante
Delegado RoutedEventHandler

Se aplica a

Producto Versiones
.NET Framework 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