topsykretts
Well-known member
- Joined
- Dec 22, 2011
- Messages
- 47
- Programming Experience
- Beginner
Hi friends, I have a problem to use "For" statement on more than 10 radio buttons on my form.
Sample for one radio button:
If Form2.RadioButton1.Checked = True Then
Form2.RadioButton1.ForeColor = Color.Red
Else
Form2.RadioButton1.ForeColor = Color.Yellow
End If
But if I want to use this on any radiobutton on my form, I will use something like this;
I know that code is wrong but you will understand what I want to do.
Thanks
Sample for one radio button:
If Form2.RadioButton1.Checked = True Then
Form2.RadioButton1.ForeColor = Color.Red
Else
Form2.RadioButton1.ForeColor = Color.Yellow
End If
But if I want to use this on any radiobutton on my form, I will use something like this;
VB.NET:
Dim i As Integer
For i = 1 To 10
If Form2.RadioButton(i).Checked = True Then
Form2.RadioButton(i).ForeColor = Color.Red
Else
Form2.RadioButton(i).ForeColor = Color.Yellow
End If
Next
I know that code is wrong but you will understand what I want to do.
Thanks