Validating radio button groups

To run this example, paste the code into a Windows Form.

Auto Dispatch)] public class Radio Button : System. The example uses the Checked Changed event to track which Radio Button is selected and reports the text of the selected Radio Button when the user clicks a Button.

The difference is that multiple Check Box controls can be selected at the same time, but option buttons are mutually exclusive.

Radio Button and Check Box controls have a similar function: they offer choices a user can select or clear.

validating radio button groups-27validating radio button groups-84validating radio button groups-72

(Inherited from Control) Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.

Button Base The following code example creates and initializes two Radio Button controls in a Group Box.

Click, Address Of radio Button_Checked Changed Button1.

Using a series of Radio Button controls, along with the Group Name property, you can create a list of mutually exclusive options.

This can be a useful alternative to using a Radio Button List.

Leave a Reply