Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To add Control Arrays At run Time?

Status
Not open for further replies.

cvl75

Programmer
Mar 8, 2002
19
US
I am trying to add a Arrays Textbox At run time, but I can't get it to work. Do anyones known how? Please help me.

Thanks In Advance
 
Initially place a textbox (edText) on your form, and set the Index property to 0.

In your program, create a textbox counter and initialize it at zero.

When you want to add another text box, do the following:

TextBoxCounter = TextBoxCounter + 1
Load edText(TextBoxCounter)

Then set the Left and top Property to position it.

Be sure to unload the boxes with something like the following:

While (TextBoxCounter > 0)
Unload edText(TextBoxCounter)
TextBoxCounter = TextBoxCounter - 1
Wend

Good Luck
------------
Select * from Users where Clue > 0
0 rows returned
 
You can also use
Load edText(edText.Ubound + 1)

Strange and wonderful (leaves you wondering how the...) things will happen if you try to Unload one of these while in an Event triggered for the controlarray e.g.
Unload in a MouseMove event for the box.

Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top