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

x
?
Solved

Collections question.

Posted on 2000-04-05
2
Medium Priority
?
202 Views
Last Modified: 2010-05-02
Is it possible to add different types of controls to a single collection? For example i would like to add an array of textboxes, check boxes, and option boxes to the same collection so I can loop through the collection and set properties of each control. Also is it possible to tell what type of control it is as you are looping throught the collection? Please provide code. Thanks
0
Comment
Question by:Jaysor
[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
2 Comments
 
LVL 1

Accepted Solution

by:
phiro earned 150 total points
ID: 2687465
Something like this :

**********START CODE

dim o as Label
dim c as new Collection
dim iTeller as integer
dim Enumerator as Object

for iTeller=0 to 100
  Set o = new Label
  c.Add o , Cstr(iTeller)
next iTeller

dim o2 as ComboBox

for iTeller=101 to 200
  Set o = new ComboBox
  c.Add o , Cstr(iTeller)
next iTeller

for each Enumerator in c
  if Enumerator is TypeOf Label
    'Do stuff with your label
  endif

  if Enumerator is TypeOf ComboBox
     'Do stuff with you ComboBox
  endif
next

************END CODE

0
 

Author Comment

by:Jaysor
ID: 2687606
Your syntax is wrong for the If statements it should read

if TypeOf Enumerator is Label then
end if


but you helped me out so thanks..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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