Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control. (Inherited from FrameworkElement.)

Gets or sets the identifying name of the object. When a XAML processor creates the object tree from XAML markup, run-time code can refer to the XAML-declared object by this name. (Inherited from FrameworkElement.)

Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route. (Inherited from UIElement.)

Positions child objects and determines a size for a UIElement. Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. (Inherited from UIElement.)

Updates the DesiredSize of a UIElement. Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. (Inherited from UIElement.)

Occurs when the left mouse button is released (or the tip of the stylus is removed from the tablet) while the mouse (or the stylus) is over a UIElement (or while a UIElement holds mouse capture). (Inherited from UIElement.)

Occurs when the right mouse button is released while the mouse pointer is over a UIElement. However, this event will only be raised if a caller marks the preceding MouseRightButtonDown event as handled; see Remarks. (Inherited from UIElement.)

The RadioButton is a control that is usually used as an item in a group of RadioButton controls.

The following illustration shows two RadioButton controls.

RadioButton Controls

You can create a single RadioButton. You group RadioButton controls by putting them inside a parent or by setting the GroupName property on each RadioButton. RadioButton and CheckBox controls have a similar function: they offer choices a user can select or clear. When RadioButton elements are grouped, the buttons are mutually exclusive. A user can select only one item at a time in a RadioButton group.

A RadioButton has two states: selected (checked) or cleared (unchecked). Whether a RadioButton is selected is determined by the state of its IsChecked property. When a RadioButton is selected, the IsChecked property is true. When a RadioButton is cleared, the IsChecked property is false. A RadioButton can be cleared by clicking another RadioButton in the group, but it cannot be cleared by clicking it again. However, a RadioButton can be cleared programmatically by setting its IsChecked property to false.

Customizing the RadioButton Control

To apply the same property settings to multiple RadioButton controls, use the Style property. To change the visual structure and visual behavior of a RadioButton, copy and modify its default style and template. For more information, see Control Customization.

Dependency properties for this control might be set by the default style of the control. If a dependency property for a RadioButton is set by its default style, the property might change from its default value when the RadioButton appears in the application. For more information, see Dependency Property Value Precedence. You can get the default style and template for RadioButton from RadioButton Styles and Templates.

The following example shows two panels that contain three radio buttons each. One radio button from each panel are grouped together. The remaining two radio buttons on each panel are not grouped explicitly, which means they are grouped together since they share the same parent control. When you run this sample and select a radio button, a TextBlock displays the name of the group, or "grouped to panel" for a radio button without an explicit group name, and the name of the radio button.