Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Making more controls at run-time (40pts)

Posted on 1998-12-11
1
Medium Priority
?
168 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
[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
1 Comment
 
LVL 2

Accepted Solution

by:
spenner earned 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

610 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