1. Common Properties:
(1) Checked property: used to set or return the radio button is selected, check the value is true, no check value is false.
(2) AutoCheck property: If the AutoCheck property is set to True (the default), all other radio buttons in the group are automatically cleared when the radio button is selected. For the average user, you do not need to change this property, with the default value (TRUE).
(3) Appearance property: Used to get or set the appearance of a radio button control. When the value is Appearance.Button, the radio button looks like a command button: When it is selected, it appears to have been pressed. When the value is Appearance.normal, it is the default radio button appearance.
(4) Text property: Used to set or return the text displayed within a radio button control, which can also contain an access key, which is preceded by a "&"
The letter of the symbol so that the user can select the control by pressing the ALT key and the access key at the same time.
2. Common events:
(1) Click event: When you click the radio button, the Checked property value of the radio button is set to True, and the Click event occurs.
(2) CheckedChanged event: The CheckedChanged event is triggered when the Checked property value changes.
The RadioButton in WPF may be different from those in the web, without attributes such as group. When using the same group of RadioButton directly into a groupbox or panel, they will automatically be a group, when used (to determine which one is selected) There are two ways:
The first method:
foreach (Control Ctrl-Groupbox1.controls) {if (Ctrl is RadioButton) { if (((RadioButton) ctrl). Checked) { //Add the action you need }}}
Second method: Add an event to each RadioButton
private void radioButton_CheckedChanged (object sender, EventArgs e) {RadioButton rb= (RadioButton) sender, if (RB. Checked) { //Add the action you need }}