Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2005, 11:11 AM
Authorized User
 
Join Date: Oct 2004
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
 
Old February 9th, 2005, 12:43 PM
Friend of Wrox
 
Join Date: Nov 2004
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.
 
Old February 10th, 2005, 05:16 AM
Authorized User
 
Join Date: Oct 2004
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
 
Old February 21st, 2005, 07:57 AM
Registered User
 
Join Date: Feb 2005
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.






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





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