Solved

Add a new Frame control with VB6 at run - time

Posted on 2011-09-23
5
249 Views
Last Modified: 2012-05-12
Dear experts!

I still use classic VB6, it works very fine in hand which know it very good.

I have a frame fraSavePic(0) – control array. Is there a way to add in run time fraSavePic(1) which will have exactly same properties and event handle for Click event? I’m sure I can do this, could you please help me with code?

 More detailed, I the new one Frame to be same size, colour and event for Click as fraSavePic(0) .
0
Comment
Question by:dvplayltd
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 36587243
Load fraSavePic(1)

or for more flexibility

Load fraSavePic(Ubound(fraSavePic))
0
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 36587554
Correction on the second part of my answer. It should be

Load fraSavePic(fraSavePic.Count)

'and to see it add something like this.
fraSavePic(fraSavePic.Count - 1).Visible = True
fraSavePic(fraSavePic.Count - 1).Left = 2500

Open in new window

0
 

Author Comment

by:dvplayltd
ID: 36587606
Well, I try it, it do not produce error, but I almost was ready to write you that do not work.

Why you do not tell me that I need to put here  ??? :-)

fraSavePic(1).Visible=true

P.S: I can't belive that it is so simple. VB is great ..last months I do a project in C++ and it is really really AWFUL!

0
 

Author Closing Comment

by:dvplayltd
ID: 36587611
10x.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 36587627
Your welcome and I apologize for not including the complete code in my first answer.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

808 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