Quote:
Originally Posted by randum77
The only part that I wouldn't know right off is how to make the property name dynamic. The rbYes is what I mean. Would i declare it as rbYes(i) or something like that? I appreciate the help. 
|
well, you could give them names IF you knew how many you were going to have, then you could hardcode them in, but since you could have anywhere form 1 to 100, this is inconvenient, redundant, and not very efficient coding to do it this way.
instead, what you probably want to do is this, just keep adding them like so
rbYes = New RadioButton()
rbYes.Left = 8
rbYes.Top = 300
Me.Controls.Add(rbYes)
rbYes.Text = "YES"
now when you want to access it you can do something like this or some variation of it.
'iterate through every radiobutton control on the form
For Each rb As RadioButton In Me.Controls
If (rb.Checked) Then
MsgBox(rb.Text & " was checked!!!")
End If
Next
you can also get to a control through its index (ex: me.controls(2))