Reviving the Control Array
I really enjoyed the control array in VB6 but the book tells me that it is no longer the same and does not go into how to recreate the same operation in VB2008. The "Help" option doesn't...
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Nov 28, 2009, 12:46 PM
For example, if you need an array for all controls in a form, then you don't need to create one; the form has a list of controls that you can use.
Another possibility is the collections in the System.Collections Namespace. They allow items of various types. The classes in the System.Collections.Generic Namespace require that all items be the same type. It is much better to use objects that require a specified type; software is usually designed better when they do. It is more work, but it is usually a better design.
You could create a class that has collections for each type of control, and then you could use generic collections.
It depends on what you need to do.
EmerogorkPosted Nov 28, 2009, 2:02 AM
I thought I had read that one could use a manipulate objects of differing type by usaing a single array. For example, if I had a form with many buttons and many text boxes. I could use one control array to enable/disable them in one felled swoop. All examples I see seem to imply that the control array has to be of one type and is dimensioned as such.
I wonder if there is any such thing as a multi-dimensional control array...?
This makes me wonder that if I did try to create one, then I would be tampering with the space time continuum...
Maybe they did not have to create the hadron collider at all...
EmerogorkPosted Nov 26, 2009, 11:05 PM
I may not be using the proper terminology here but I do have one working enough to continue experimenting. My professor says that if I add things beyond the what is covered in the course, I can boost my grade for the project to the "A" level. I am going to use it to switch off all the objects on the display when I one hits the "Off" button.
Thanks for the offer though...
Kirtan PatelPosted Nov 26, 2009, 9:56 PM
just tell me What you exactly want to Do with Control just tell me may be i can help you :)
EmerogorkPosted Nov 26, 2009, 7:45 PM
For now, I am stuck with the book that was purchased for the course.
However, I just discovered in the index that the concept of the "Control Array" is not listed but the "Array Control" is.
Maybe someone should tell the DDOTS that write the book that an entry for Control Array should say "See Array Control". (-: No wonder I did not see it. From a simple glance, it looks to be about 90% of what it was in VB6.
I may have solved my own problem here...
Sam HobbsPosted Nov 23, 2009, 11:29 PM