System.Windows.Forms.RadioButton Class

Enables the user to select a single option from a group of choices when paired with other System.Windows.Forms.RadioButton controls.

See Also: RadioButton Members

Syntax

[System.ComponentModel.Designer("System.Windows.Forms.Design.RadioButtonDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DefaultBindingProperty("Checked")]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.ComponentModel.DefaultEvent("CheckedChanged")]
[System.ComponentModel.DefaultProperty("Checked")]
public class RadioButton : ButtonBase

Remarks

The System.Windows.Forms.RadioButton control can display text, an System.Drawing.Image, or both.

When the user selects one option button (also known as a radio button) within a group, the others clear automatically. All System.Windows.Forms.RadioButton controls in a given container, such as a System.Windows.Forms.Form, constitute a group. To create multiple groups on one form, place each group in its own container, such as a System.Windows.Forms.GroupBox or System.Windows.Forms.Panel control.

System.Windows.Forms.RadioButton and System.Windows.Forms.CheckBox controls have a similar function: they offer choices a user can select or clear. The difference is that multiple System.Windows.Forms.CheckBox controls can be selected at the same time, but option buttons are mutually exclusive.

Use the RadioButton.Checked property to get or set the state of a System.Windows.Forms.RadioButton. The option button's appearance can be altered to appear as a toggle-style button or as a standard option button by setting the RadioButton.Appearance property.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0