I have a grid of RadioButtons, and need some help in Check / Uncheck acording to data collected from a .txt file.

The .txt file contains a list like this:

I have set up in a grid formation RadioButtons, and named them A01,B01,C01,A02,B02,C02.
I have loaded the .txt file in an array, and want to use the first 3 letters in the array to point to the RadioButton.

How do I get the string "A01" from the array to point to the RadioButton control?

Nailed it a couple of hours ago, and haven't gotten around to update thread.

Btw. Left() doesn't work. Have to use:

Array(Integer).Substring(Start as Integer, Length as Integer)

Solution to OP:

Had to DirectCast it.

Dim RB as RadioButton
RB = DirectCast(Me.Controls(Array(Integer).Substring(1,3)), RadioButton)
RB.Checked = True

Run it in a loop for each post in file, and put code for handeling each button in turn.

Thankyou for reply tho Jx_Man :)

Edited 5 Years Ago by lcfjoertoft: n/a

This question has already been answered. Start a new discussion instead.