Please, give me a code... or link.
Printable View
Please, give me a code... or link.
well do you want an array of controls? or a control array??
what are you trying to do exactly?
I need an array of controls...
ok well lets say you have 2 text boxes on your form and you want to load them into an array
VB Code:
Dim txtBoxArray(1) as TextBox txtBoxArray(0) = Text1 txtBoxArray(1) = Text2
where Text1 and Text2 are the text boxes on your form..
if you wanted labels and textboxes in the same array you could do something like
where Text1 and Text2 and Label1 are the controls on your form..VB Code:
Dim MyControls(2) as Control MyControls(0) = Text1 MyControls(1) = Text2 MyControls(2) = Label1
Thank you.
But If I need 64 (chess) TextBoxes???
you would be better off with a control array for this than an array of controls... just make 64 boxes and name them all the same thing.. then they will all have an index property which is how you reference the individual boxes..
but why would you be using textboxes for a chess game?
OK, thanks.
The chess I've said for example...