dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Need help in Control Array

  1. #1
    Join Date
    Jan 2007
    Posts
    15

    Question Need help in Control Array

    Pls. help on how to access every textboxes made from a control array.

  2. #2
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    In this example my control array is called txtFields:
    Code:
      Dim I As Long
      For I = Me.txtFields.LBound To Me.txtFields.UBound
        Debug.Print I, Me.txtFields(I).Text
      Next I

  3. #3
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    and do not forget to put a on error, in case one of the index doe snot have a control associated to it (i.e. there is control 1, 2, 4, 5 and not control 3) Another way to di this is to use foreach:

    Dim c As Control
    For Each c In Text1
    Debug.Print c.Text
    Next
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

Similar Threads

  1. Counting controls in a control array in VB6
    By Eldin in forum VB Classic
    Replies: 3
    Last Post: 03-08-2006, 10:44 AM
  2. Replies: 5
    Last Post: 05-24-2002, 05:10 AM
  3. Passing a control array to a method
    By Willy Van den Driessche in forum VB Classic
    Replies: 6
    Last Post: 09-24-2001, 01:44 PM
  4. Replies: 15
    Last Post: 05-09-2001, 04:40 AM
  5. control arrays
    By ou_soonerfan in forum .NET
    Replies: 26
    Last Post: 02-27-2001, 05:13 AM

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