Solved

Problem with Control Arrays

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

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!

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

733 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