Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Creating Text Boxes at run-time

Posted on 1998-11-11
5
Medium Priority
?
138 Views
Last Modified: 2010-04-30
How would I create text boxes at run time, then manipulate or add text to them? Can this be done?
0
Comment
Question by:cantrell
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1444415
I think you need to start with a control array for the first text box and then you can dynamically add elements to the array. However the control itself cannot be created from scratch in VB5. VB6, I have heard, allows this.

M

0
 
LVL 2

Author Comment

by:cantrell
ID: 1444416
Could you give me an example?
0
 
LVL 2

Expert Comment

by:schild
ID: 1444417
You put one TextBox in the form, you may want to make it invisable. Then you set the "Index" property to 0.

At runtime you doing this:
Load TextBox1(1)
TextBox1(1).Visible = True
TextBox1(1).Top = TextBox1(1).Top + 500

Good Luck
Schild
0
 
LVL 2

Author Comment

by:cantrell
ID: 1444418
Ok, that creates one text box. Now, how about the others?
0
 
LVL 2

Accepted Solution

by:
schild earned 150 total points
ID: 1444419
all you have to do is changing the Index value
because you cant repeat loading the same control several times
so if you want to load 10 controls do like this

For CtrlIndx = 1 to 10
  Load TextBox1(CntrlIndex)
  TextBox1(CtrlIndx).Visible = True
  TextBox1(CtrlIndx).Top = TextBox1(CtrlIndx).Top + 500*CtrlIndxNext
Next

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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 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…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month20 days, 23 hours left to enroll

810 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