[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Control Array

Posted on 2004-10-27
7
Medium Priority
?
239 Views
Last Modified: 2010-05-02
Hi:
     Is there a property or object that keeps track of the total number of items in a control array?
(Please include example with code in your explanation.)
0
Comment
Question by:LearningJava
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 900 total points
ID: 12424419
Sure.  If you had a textbox control array called text1, you could determine the number of textboxes in it like this:

    Private Sub Command1_Click()
        Dim arrayCount As Integer
        arrayCount = Text1.Count
        MsgBox arrayCount & " TextBoxes in Control Array Text1"
   End Sub

~IM
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 12424472
A Mini Control Array Management
--------------------------------------------
Processing a Control Array

    http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20174598.html

Range of Control Array Indexes

    http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_10261311.html

Count ,Highest and Lowest Index

YourControl.ubound = upper bound
YourControl.lbound = lower bound
YourControl.count = total number of coontrols in array

0
 

Author Comment

by:LearningJava
ID: 12424579
Idle Mind:
               What is count? A property? Please elaborate.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 48

Expert Comment

by:Mikal613
ID: 12424599
am i involved in this question?
0
 
LVL 48

Assisted Solution

by:Mikal613
Mikal613 earned 300 total points
ID: 12424605
The Count is the Total number of Controls in your Array

A Property is a Attribute to your Control.

For example.

The Color or text is a Property of your Control
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 12424641
Right.

It's one of the properties exposed by a control array which Mikal613 already listed:

    Text1.LBound ' The index of the last textbox in the control array
    Text1.UBound ' The index of the first textbox in the control array
    Text1.Count   ' The number of textboxes in the control array

There is one more:

    Text1.Item     ' Used to access the individual items in the array

but usually you don't see .Item() used since the following two lines are equivalent:

    Text1(1).Text = "something"
    Text1.Item(1).Text = "something"

~IM
0
 
LVL 4

Assisted Solution

by:AjithJose
AjithJose earned 300 total points
ID: 12424948
I think this will sample code will help you:

Suppose you have an array of TextBox controls named txtArray , then

'Total no of items in the control array

MsgBox "No of Items in the Control Array=" & txtArray.Count

'You can access individual array items as

For i=txtArray.LBound to txtArray.UBound
      txtArray(i).Text="Item No: " & i
Next

~Ajith

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question