Solved

Making more controls at run-time (40pts)

Posted on 1998-12-11
1
143 Views
Last Modified: 2010-05-03
I need to know how I can create more controls on the screen at run time, so that I can keep on, for example, creating text-boxes, with no limit, and be able to change and set properties at run time?
0
Comment
Question by:The_Oracle
1 Comment
 
LVL 2

Accepted Solution

by:
spenner earned 40 total points
ID: 1449565
You have to use what is known as a control array.  What you do is put a control on the form of whatever type you want to duplicate.  To add another one, use

Load mycontrol(index)

where index is the next available number.  So if you're justt starting, index would be 1
You can also use

Load mycontrol(mycontrol.ubound+1)

Then set its properties

mycontrol(index).visible = true
mycontrol(index).top = 500

You can get the number of controls in the control array by using
total = mycontrol.ubound

To remove a control from the control array use

Unload mycontrol(index)

The control array starts at index = 0
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

831 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