I tried something like:
RadioButton[] diff = new RadioButton[10];
for (int i = 0; i < 10; ++i)
{
diff[i] = (RadioButton)Control("rad_D" + i.ToString());
}
Clearly does not work. But what was the correct way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: Ok, so you are looking for already existing RadioButtons, in that case, use FindName. Something like this:
You need a parent control, which can just be the window itself as it will search recursively for a matching name.