How can to make control arrays in vb.net ?
there is no INDEX property or Load method like VB6.
so how i can do it ? :wave:
Printable View
How can to make control arrays in vb.net ?
there is no INDEX property or Load method like VB6.
so how i can do it ? :wave:
Control arrays are no longer supported in VB.NET
Though, you can easily create an equivalent
Code:'declare an array and fill it with elements you want
Dim myTextBoxes() as TextBox = {TextBox1, TextBox2, TextBox3, TextBox4, TextBox5}
'Then use it like this
myTextBoxes(2).Text = "whatever"
hmm.. typo.
I corrected it on the original post.
Wow !!
no supported !!
thanx for this code.
Yes, it is not supported in .net as better ways are available.
You can create a control dynamically, and you can declare an array of controls too. So there's no need for a control array as was in VB6 and earlier. Though it would have been nice if it were supported.
Since they were breaking backward compatibility with introduction of .net anyways, they felt better to do away with it. :)