creating arrays of objects (textboxes)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: creating arrays of objects (textboxes)

  1. #1
    zoes Guest

    creating arrays of objects (textboxes)


    Hi all!
    I'm new to vb and expecially ado. I've made a connection to the database
    (access) and built a couple of forms that put data in the database and I
    can search through the data base and populate the recieving forms (objects),
    BUT IT'S SUCH A PAIN IN THE ***!! I have if this and if that ...(controls^(n-1))times.
    So what I want to do is create an array of controls (text boxes in particular)
    so I can loop through a procedure or function with the array and perform
    whatever on the data.
    I've tried Dim thesetexts as controls(5)
    , Dim thesetexts as textboxes(5) etc.........
    NO LUCK ! I'm pretty comfortable with objects and have an understanding
    of object programming (C++) but, like I said I'm new to VB so.......? Any
    Help (including criticism) welcome..
    New to the sight, so if I'm in the wrong place, Please disregard.
    Peace!

  2. #2
    Robert Gelb Guest

    Re: creating arrays of objects (textboxes)

    Simply set the Index property of the textbox to 0, then create another
    textbox with the same name and set its Index to some other number. That
    will create an array of textboxes.

    --
    Robert Gelb

    "zoes" <wilscott@earthlink.net> wrote in message
    news:3925c6c0$1@news.devx.com...
    >
    > Hi all!
    > I'm new to vb and expecially ado. I've made a connection to the

    database
    > (access) and built a couple of forms that put data in the database and I
    > can search through the data base and populate the recieving forms

    (objects),
    > BUT IT'S SUCH A PAIN IN THE ***!! I have if this and if that

    ....(controls^(n-1))times.
    > So what I want to do is create an array of controls (text boxes in

    particular)
    > so I can loop through a procedure or function with the array and perform
    > whatever on the data.
    > I've tried Dim thesetexts as controls(5)
    > , Dim thesetexts as textboxes(5) etc.........
    > NO LUCK ! I'm pretty comfortable with objects and have an understanding
    > of object programming (C++) but, like I said I'm new to VB so.......? Any
    > Help (including criticism) welcome..
    > New to the sight, so if I'm in the wrong place, Please disregard.
    > Peace!




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center