Prevent multiple selection in a control of checkboxes

Hi,
I’m attempting create a quizz app.
Created a new control of 4 checkboxes namely:
AnswerCheckBox(0)
AnswerCheckBox(1)
AnswerCheckBox(2)
AnswerCheckBox(3)

How do I write a code to allow the user to select only ONE of the 4 checkboxes?
I think I need to use a loop to run through the controls but could not figure out how.

Any pointers greatly appreciated.

You could use RadioButtons which would do this automatically.

If you really want CheckBoxes, you could put code in the Action event to uncheck all the other CheckBoxes.

Looks like you’re using a Control Set, so something like this:

For i As Integer = 0 To 3 If i <> index Then AnswerCheckBox(i).Value = False End If Next

Thank you very much.
Will look into RadioButtons as well.

Greatly Appreciated

If I use a radiobutton control, how do I use loop to check which radiobutton was selected?

Thanks,
Benny

Thank you very much!.
Please ignore the last question regarding radiobutton. Figured that out!

Please, what is the answer to this question?

I think it was .index?

[quote=422412:@Detlef Kahner]Please, what is the answer to this question?

I think it was .index?[/quote]
You can name RadioButtons individually and check their Value property. You can also create a control array if that suits you, but I find that more difficult to maintain personally.