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:
A01,a
B01,b
C01,c
A02,a
B02,b
C02,c


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.

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

Use Left() function.

No.
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 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.