ToggleButton.Checked Event

 

Occurs when a ToggleButton is checked.

Namespace:   System.Windows.Controls.Primitives
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Event Checked As RoutedEventHandler

Identifier field

CheckedEvent

Routing strategy

Bubbling

Delegate

RoutedEventHandler

The following example changes subscribes to the Checked and UncheckedEvent events to change the FontStyle of the 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>
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

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: