Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a question.... I'm building a ASPX/VB form that builds dynamic controls based on user input and I can't get it to work to save my life... Basically, the user is given a form to describe an object (actually a storage container in a factory, but neither here nor there.) Anyway, the user puts in the basic info but the last line asks "How many containers?" This allows the user to put in a specified number that will then create dynamic text boxes that allows the user to input uniquie names for the number of containers specified and then inputs the results into a SQL table... For example....

 

 

Name: container 1

Property: Property1

Color: Red

Size: Big

Contents: Waste Product

 

I'm I assuming you use controls.add but how do you make it dynamic? where you are creating X number of textboxes? Any help would be greatly appreciated.:confused:

  • Moderators
Posted

try this..

For x = 1 To 20
 txt = New textbox()
 With txt
   AddHandler .GotFocus, AddressOf txtClick
   .Text = "Textbox " & x.tostring
   .Location = New Point(0, x * 25)
   .Size = New Size(200, 60)
 End With
 Controls.Add(txt)
Next

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...