|
-
Feb 28th, 2010, 02:49 AM
#1
Thread Starter
Lively Member
Control Arrays
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 ?
-
Feb 28th, 2010, 03:30 AM
#2
Re: Control Arrays
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"
Last edited by Pradeep1210; Feb 28th, 2010 at 03:42 AM.
-
Feb 28th, 2010, 03:37 AM
#3
Frenzied Member
Re: Control Arrays
 Originally Posted by Pradeep1210
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
myTextBox(2).Text = "whatever"
where is the "es" of gone pradeep
If you find my reply helpful , then rate it
-
Feb 28th, 2010, 03:42 AM
#4
Re: Control Arrays
hmm.. typo.
I corrected it on the original post.
-
Feb 28th, 2010, 03:42 AM
#5
Thread Starter
Lively Member
Re: Control Arrays
Wow !!
no supported !!
thanx for this code.
-
Feb 28th, 2010, 03:53 AM
#6
Re: Control Arrays
 Originally Posted by 3Dmajid
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|