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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

724 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