Does anyone know how to add a control Array of text boxes or labels to the Form.Controls Collection. I need this so I can generate an entry form from a script held in a database. <br>Nick<br><br>
if you are in design mode then just create a textbox and go on pasting it (after copying the text box) on the form . for the first time VB will ask you to create a control array or not. if u want to do it through code then just create a textbox and set its index property to 1. Now the following code should work<br><br>Dim x as textbox<br><br>x= New textbox<br><br>this will create a new textbox.<br><br>hope this helps<br><br>Nikhil
Also not that you MUST have a control of the type you need an array of on the form AT DESIGN TIME, and it MUST already have an index (control arrays are usually indexed from 0 in VB).<br><br>Also, not that controls added at run time inherit most of the properties of the "original" control, this means that they will - by default be placed directly on top of the "orignial", so - to use them, you MUST to reposition them on the form.<br><br>Michael<br>
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.