ToggleButton.Unchecked Event

 

Occurs when a ToggleButton is unchecked.

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

public event RoutedEventHandler Unchecked

Identifier field

UncheckedEvent

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

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

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