开发者

Unable to select more than 1 radio button

I have 4 radio buttons, r1, r2, r3, r4. These four radio buttons are in a group box.

r1 and r2 for asking the gender of person.

r1 for Male , r2 for Female

r3 and r4 for asking whether the user would like to continue.

r3 for Yes , r4 for No.

When I click 开发者_StackOverflow社区r1 , r3 becomes unchecked and vice versa. Similar is the case with r2 , r4. So at a time I can check only one radio button. How can I get around this problem . The groupbox is essential so I cannot remove it.


Radiobuttons are grouped by their parent-control. It would be sufficient to re-group them in a Panel.

Current Layout:

Groupbox
    RadioButton
    RadioButton
    RadioButton
    RadioButton

New Layout:

Groupbox
    Panel
        RadioButton
        RadioButton
    Panel
        RadioButton
        RadioButton


Make sure the gender radio buttons and the yes/no radio buttons do not belong to the same radio button group - they need to be separate radio button lists.


You can only select 1 Radiobutton in a Groupbox if there is no other subcontrol like Panel
So you have to create a Groupbox for r1 and r2

and a separate for r3 and r4


Group Box = you have to select only one radio button. Use two Group Boxes instead, one for the gender and one for asking whether to continue.


For radiobutton r1 and r2 use GroupName = "Gender"

For radiobutton r3 and r4 use GroupName = "ContinueOrNot"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜