Updated: April 2009
Represents a button that can be selected, but not cleared, by a user. The IsChecked property of a can be set by clicking it, but it can only be cleared programmatically.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
A has two states: true or false.
The is a control that is usually used as an item in a group of controls. However, it is possible to create a single . Whether a is selected is determined by the state of its IsChecked property.
When a is selected, it cannot be cleared by clicking it. When elements are grouped, the buttons are mutually exclusive. A user can select only one item at a time within a group. You can group controls by placing them inside a parent or by setting the GroupName property on each .
Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Themes.
The following example shows how to create controls, group them inside a container, and handle the Checked event.
The following code sample creates two separate groups: colorgrp and numgrp. The user can choose one in each group.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.