Guest waltfish Posted August 22, 2002 Posted August 22, 2002 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)? thanks Quote
Guest Cert Posted August 22, 2002 Posted August 22, 2002 Yes, just create an array of objects. 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. Quote
Guest waltfish Posted August 22, 2002 Posted August 22, 2002 Cert, 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. thanks Quote
*Gurus* Thinker Posted August 22, 2002 *Gurus* Posted August 22, 2002 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. Quote Posting Guidelines
*Gurus* divil Posted August 23, 2002 *Gurus* Posted August 23, 2002 It's likely that in the next version of VS.NET the designers will support control arrays natively. As an aside, Microsoft, in the latest beta, have already implemented Windows Forms Designers for MC++. Impressive. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.