다음을 통해 공유


RadioButton Control Overview (Windows Forms)

Windows Forms RadioButton controls present a set of two or more mutually exclusive choices to the user. While radio buttons and check boxes may appear to function similarly, there is an important difference: when a user selects a radio button, the other radio buttons in the same group cannot be selected as well. In contrast, any number of check boxes can be selected. Defining a radio button group tells the user, "Here is a set of choices from which you can choose one and only one."

Using the Control

When a RadioButton control is clicked, its Checked property is set to true and the Click event handler is called. The CheckedChanged event is raised when the value of the Checked property changes. If the AutoCheck property is set to true (the default), when the radio button is selected all others in the group are automatically cleared. This property is usually only set to false when validation code is used to make sure the radio button selected is an allowable option. The text displayed within the control is set with the Text property, which can contain access key shortcuts. An access key enables a user to "click" the control by pressing the ALT key with the access key. For more information, see How to: Create Access Keys for Windows Forms Controls and How to: Set the Text Displayed by a Windows Forms Control.

The RadioButton control can appear like a command button, which appears to have been depressed if selected, if the Appearance property is set to Button. Radio buttons can also display images using the Image and ImageList properties. For more information, see How to: Set the Image Displayed by a Windows Forms Control.

See Also

Tasks

How to: Create Access Keys for Windows Forms Controls
How to: Set the Text Displayed by a Windows Forms Control
How to: Group Windows Forms RadioButton Controls to Function as a Set

Reference

Panel Control Overview (Windows Forms)
GroupBox Control Overview (Windows Forms)
CheckBox Control Overview (Windows Forms)
RadioButton

Other Resources

RadioButton Control (Windows Forms)