In a form with multiple similar objects, say 10 CheckBoxes, is it possible to reference them as an array (e.g. CheckBox) rather than individually (e.g. CheckBox1, CheckBox2)?
Draw a checkbox on your form, select it, press CTRL+C (copy), then click on the form so it has the focus, and press CTRL+V (paste) and it will ask you if you want to create an array of the same item.
Doing some will allow you to access them by CheckBox(0), CheckBox(1), etc.
thanks for the reply. actually, i'm not prompted for array creation using this method. is there another way to create the array? btw, i'm using VB.NET to create a Windows Form Application.
In .net you will have to define an array of the type of your control.
You will have to addhandler for each event. There have been a
number of threads about this subject in this board and some very
good explanations.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.