Solved

Problem with Control Arrays

Posted on 1998-07-02
2
126 Views
Last Modified: 2010-05-03
I have a Frame on my program's main form.  In this Frame I have a Picturebox and a Textbox.  Now I have button that when I click this button I want to dynamically add a new Frame with Picturebox and Textbox to the bottom of the form.

This is the code I have to add the controls.
  iCounter = iCounter + 1
  Load Frame(iCounter)
  Load imgPicture(iCounter)
  Load txtAdCopy(iCounter)
  imgPicture(iCounter) = LoadPicture(sFilename)
  txtAdCopy(iCounter) = sAdCopy
  Frame(iCounter).Top = (iCounter * Frame(iCounter).Height) - 100
  Frame(iCounter).Visible = True
  imgPicture(iCounter).Visible = True
  txtAdCopy(iCounter).Visible = True
  Me.Height = Frame(iCounter).Top + Frame(iCounter).Height + 900

Now when this executes I have get a new frame that appears in the correct location, but I don't have any Picture Controls or Textboxes.  I know they are being created, because I'm setting there values to something without any problem.  Where are they and how to I have to position them so that they are in the Frame.
0
Comment
Question by:Jagar
2 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 50 total points
ID: 1464797
yes, you can do this:
set imgPicture(iCounter).container = frame(iCounter)


0
 
LVL 2

Author Comment

by:Jagar
ID: 1464798
Thanks that is what I was looking for.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now