Comparteix a través de


ToggleButton.Checked Evento

Definición

Se produce cuando se activa ToggleButton.

public:
 event System::Windows::RoutedEventHandler ^ Checked;
public event System.Windows.RoutedEventHandler Checked;
member this.Checked : System.Windows.RoutedEventHandler 
Public Custom Event Checked As RoutedEventHandler 

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.

<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>
void chkbox_Unchecked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Normal;
}

void chkbox_Checked(object sender, RoutedEventArgs e)
{
    textBlock1.FontStyle = FontStyles.Italic;
}
Private Sub chkbox_Unchecked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.FontStyle = FontStyles.Normal
End Sub

Private Sub chkbox_Checked(ByVal sender As Object, ByVal e As RoutedEventArgs)
    textBlock1.FontStyle = FontStyles.Italic
End Sub

Comentarios

Información sobre eventos enrutados

Campo identificador CheckedEvent
Estrategia de enrutamiento Burbujeante
Delegado RoutedEventHandler

Se aplica a