| Home | Previous Lesson: RadioButton Next Lesson: Picture |
The GroupBox control is used to group related objects together, but it is generally used to group sets of related RadioButtons together. When there is no GroupBox in the window, the window behaves as a GroupBox. That's why, you can select only one RadioButton, no matter how many RadioButtons are there on the window.
For example, you have two questions, one is "Marital Status" and another is "Sex". In this situation, you need one answer for each question. If at least one question is not in a GroupBox, user can't answer both questions, since he would be able to select only one option for both questions together. The solution for this problem would be, either put each set of answers in a group box separately or put at least one set of answers in a GroupBox. If you put one set in a GroupBox, window behaves like a GroupBox for another set of RadioButtons.
Place a GroupBox on the window and move "Male" and "Female" RadioButton into the GroupBox. In this situation, it is not necessary to display the GroupBox to the user, since it is for internal purpose. What you could do is, turn off the Visible property. Now, preview the window and see how it works.
| Home | Previous Lesson: RadioButton Next Lesson: Picture |