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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Add Text Boxes

Status
Not open for further replies.

nvwildfire

Technical User
Aug 15, 2002
43
US
Hi list.

I am trying to generate a matrix of text boxes based on a users input (i.e. the user selects 6 on my frmCreateMatrix form and the form frmMatrix pops up with a matrix of 6 x 6 text boxes). I'm not so worried about the looping code to do this but I have no idea how to create a text box at run time. Once I figure out how to create it then palacing it and nameing should be easy?

Anyway if anyone knows how to dynamically create text boxes at run time let me know. I'm sure its easy but I can not seem to find anything in my reference books.

thanks in advance

kgk
 
Place the first text box on the form, assign the index property to 1 then in code use:

count = TextBox1.Ubound + 1
Load TextBox1(count)
TextBox1.visible = true
TextBox1.Left = ?
TextBox1.Top = ?

Rob
 
rdavis,

thanks for the code, it works like I wanted.

kgk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top