

You can place any type of control in a group box.

The GroupBox component is less convenient to use than the RadioGroup component, but it has more flexibility. You can also use a GroupBox component to hold radio buttons. Oh, by the way-the answer to the quiz is Redtailed Hawk (American Kestrel would also have been an acceptable answer, but it was not presented in the list). Like the ListBox and ComboBox components discussed earlier, the RadioGroup component has an ItemIndex property that you can read at runtime to determine which item in the group is selected. Using the RadioGroup component, you can put more than one group of radio buttons on a form. When you click one of the radio buttons, the previously selected button pops up as expected.

Place a RadioGroup component on the form. Create a blank form or use the form you created in the previous exercise.To illustrate this concept, do the following exercise: This component allows you to quickly set up a group of radio buttons with a 3D frame around the buttons and a caption as well. If you have more than one group of radio buttons, and those groups need to operate independently of one another, you need to use a RadioGroup component. When tempted to use a radio button by itself, use a check box instead-that's what a check box is for, after all.Īny buttons placed on a form will automatically be considered part of the same group. Although you can use a radio button by itself, it is not recommended because it is confusing to your users.

A radio button typically signifies a group of options, only one of which can be selected at one time (like a group of speed buttons, which you just learned about). The radio button is usually used in a group of buttons. Both the RadioButton and CheckBox components have a property called Checked that can be used to set the check state and can be read to retrieve the current check state. I'm not going to spend a lot of time discussing these two buttons because implementing them is pretty straightforward. Radio buttons and check boxes are specialized buttons but are, in the end, still buttons.
