Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 9th, 2005, 11:11 AM
Authorized User
 
Join Date: Oct 2004
Location: Hyderabad, Andhra Pradesh, India.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default How many control arrays can be placed in a form

Hi,

My Question is :

Normally a form in VB Project supports 254 controls, but when create control arrays for a particular control, it creates more. How is it possible and what is the maximum limit of control arryas in a form?

Expecting reply.

Ramkumar

A.D.Ramkumar
__________________
Ramkumar A D
Reply With Quote
  #2 (permalink)  
Old February 9th, 2005, 12:43 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I haven't looked into this, but I would guess that each array can have 254 controls.
I also would suspect that possibly there is a limit of 254 control arrays.

This (if it is so) would have to do with the number of distinct values that 1 byte can represent. The form would have 1 byte to uniquely identify each top-level object on its face. The indexing mechanism of the controls collection would be 1-byte.

If that is indeed so, the the control arrays would be the type of item held in that collection, so there could only be 254 of them.
Reply With Quote
  #3 (permalink)  
Old February 10th, 2005, 05:16 AM
Authorized User
 
Join Date: Oct 2004
Location: Hyderabad, Andhra Pradesh, India.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

As i have tested a form supports 254 controls but if copy a control and go on pasting it in the same form, it takes more than 254 controls and as for as i have tested above 1000 control arrays.

Ramkumar

A.D.Ramkumar
Reply With Quote
  #4 (permalink)  
Old February 21st, 2005, 07:57 AM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The number of elements in a control array is determined by the Index property for that object. This property will not exist for objects unless in a control array. The maximum value for index is 32767 (2^16 minus 1), including the zero(th) element this makes 32768 (2^16) elements for a control array.

Although in adding controls to a control array will automatically provide a successive list of index values for these objects (0,1,2,3,4....) this property can be set by the developer manually for each object, this can be useful if some controls are in the incorrect order, visually.

All the Best.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control Arrays in VBA? Sanchin Excel VBA 3 March 24th, 2008 04:20 PM
Arrays & Form Fields rdmapes Beginning PHP 5 October 12th, 2006 11:12 PM
control arrays Jayahar General .NET 0 October 3rd, 2005 12:20 PM



All times are GMT -4. The time now is 04:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.