Solved

Creating Text Boxes at run-time

Posted on 1998-11-11
5
135 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 50 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…

688 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