Solved

Problem with Control Arrays

Posted on 1998-07-02
2
135 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
[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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

717 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