|
-
Jan 6th, 2004, 02:00 AM
#1
Thread Starter
Junior Member
Assigning Controls to an Array with arbitrary Index
Hi All
I have got the idea that the Control Arrays no longer exist in VB.Net. I can use an Array of Controls to simulate it though. My application in VB has a lot of textboxes on the Forms.
Further, these Forms are divided into some pre-defined section. Loosely based on the Sections, I gave an index to the Textbox...e.g. the numbering of textboxes in Section 1 would start as 1001, 1002...and so on. Similarly in Section 2, the textboxes would be numbered like 2001, 2002 etc.
I was using this Indexing for various purposes like applying validation to all similar kinds of Textboxes. Is there any way I can assign the controls to the array on similar indices and use it the way I was doing earlier.
Using the Name or the tag property to contain the Index would not be a good idea. I have around 700 to 800 controls and iterating through the entire collection of controls to arrive upon the required textbox might be expensive.
Thanx
Isha
Last edited by ishaaseja; Jan 6th, 2004 at 02:19 AM.
-
Jan 6th, 2004, 04:30 AM
#2
Hyperactive Member
control array is not there in vb .net but u can create an array of txtboxes orwhatever at runtime and then u can loop through those....
-
Jan 6th, 2004, 04:35 AM
#3
Thread Starter
Junior Member
But I want to assign specific indices to these Controls in the Array.
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
|