Unfortunately you can't use a string to name a control in this way.
Code:
"lblTaken"xy".text" = ""
There are several ways you can approach this. The easiest but least satisfying is to just clear them individually:
Code:
lblTaken00.Text = ""
lblTaken01.Text = ""
lblTaken02.Text = ""
...
Probably if you are going to turn this into a more realistic program, you would want to make an array holding the labels. Then you can loop through the array to clear them out. Arrays are described in Lesson 16, although I don't think that lesson revisits the Tic-Tac-Toe program.
The program would declare the array outside of any method:
Code:
Private Labels As Label(,)
When it starts, the program would initialize the array something like this:
Code:
Labels = New Label(,) _
{ _
{lblTaken00, lblTaken01, lblTaken02}, _
{lblTaken10, lblTaken11, lblTaken12}, _
{lblTaken20, lblTaken21, lblTaken22} _
}
Later you can loop through the array like this:
Code:
For r As Integer = 0 To 2
For c As Integer = 0 To 2
Labels(r, c).Text = ""
Next c
Next r
This is all getting pretty far ahead of the Tic-Tac-Toe program in Lesson 2 but perhaps later you can revisit this and see if you can make it work.