?
Solved

Creating Text Boxes at run-time

Posted on 1998-11-11
5
Medium Priority
?
136 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
[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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 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