Solved

Making more controls at run-time (40pts)

Posted on 1998-12-11
1
124 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 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…

707 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

13 Experts available now in Live!

Get 1:1 Help Now