i want to add some controls onto every picturebox  in the contral array, how?

Posted on 2002-03-08
Last Modified: 2010-08-05
for example,

i want every picturebox in the array will show one or two buttons, how to do that?


Question by:cc_2000_sg
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

Expert Comment

ID: 6850005
Could you please give more details about the question. Are you using control array?

Author Comment

ID: 6850068

i am using control array.

and i want all picture box in the array will contain other controls, such as some command buttons, some lines, even other control arrays.


Expert Comment

ID: 6850095
Can you explain your problem in detail?!!!
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!


Expert Comment

ID: 6850145
Will u pls try with more details...

Accepted Solution

tandrei earned 100 total points
ID: 6850563
At design time put a picture box say it pic(0). There, load another array of controls say but(0).
Define all your arrays of controls with a maximum dimension. Be careful, cause you cannot delete a position from a control array, if you use unload pic(i) it will remain a gap in the array.
 Use Load pic(i) for the container, and then Load but(i) for the components you want to load.
 To determin if a control is loaded or not use the VarType function (if, say pic(1) is loaded, then VarType(pic(1))<>9, so this is the condition
LVL 22

Expert Comment

ID: 6850887
Dynamically load the buttons, then set them into the desired containers:

' Load an OK and Cancel button into ten pictureboxes
for i=1 to 10
Load cmdOK(i)
Set cmdOK(i).Container = picSomething(i)
cmdOK(i).move 0,100

Load cmdCancel(i)
Set cmdCancel(i).Container = picSomething(i)
cmdCancel(i).move 0,500
next i

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSON Response and request in VB6 application 11 823
MS Access Search and Replace Using VBA 6 92
Spell Check in VB6 13 137
VB6 - Scroll Mouse wheel on Picturebox 13 98
Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

726 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