
Originally Posted by
techgnome
Actually, I'm impressed you aren't getting NULL REference errors... you've defined the array, but it's empty.... (why is the array an array of labels anyways).
Code:
Dim LabelArray(8) As Label = {new Label, new Label, new Label, new Label, new Label, new Label, new Label, new Label}
NOW you can use the array of labels (why is it labels again?)
-tg
Actually, he (tries to) set the array values in the SetControlArray method.
OP:
I think you want this:
Code:
Sub SetControlArray()
LabelArray(0) = txtAnswer1
LabelArray(1) = txtAnswer2
LabelArray(2) = txtAnswer3
'etc
End Sub
(Notice the lack of the Text property!)
That is assuming that 'txtAnswer..' are Label controls and not TextBoxes as their name might imply.