Solved

Making more controls at run-time (40pts)

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

739 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