Radio Button

The RadioButton control allows you to create a group of buttons from which the end user can select only one button at a time from the group of buttons. These are usually positioned and operated on as a group from inside the group box. When you place the RadioButtons inside a group, it forms a button group(vb grouped radiobutton). Only one radio button in a group can be selected at a time. Selecting one radio button immediately clears all the other radio buttons in the group. The checked property can be either True or False. When True, the radio button is selected. When False, the radio button is deselected.

By placing a container control on the form and then placing RadioButton controls inside the container control, you can have multiple groups of radio buttons on the same form. The most common container controls are the GroupBox control and the Panel control. The main difference between the two is that the GroupBox control has a visible border around it, and the Panel does not. When using a container control to group radio buttons, the GroupBox control is the best choice, because the border provides a visual cue that the group of choices belongs together.

When working with RadioButtons in a button group, it is often desirable to have one event handler handle the CheckedChanged event for all of the RadioButton control instances in a button group. This is done by creating a multicast event handler as shown in the VB grouped radiobutton example below.

RadioButton Example

In above example(refers to Vb2005) we can replace radGroup1_CheckedChanged with XYZ, as it is just a given name.