• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • Last Modified:

Dynamically create text boxes to a new panel

Hello again everyone.

Have a code to dynamically create text boxes.  It puts it on the main form.  I need it to go to
a new panel.  

Howz do you do it?
0
TechMonster
Asked:
TechMonster
  • 4
  • 2
1 Solution
 
davidrichardsonCommented:
       Dim txt As New TextBox
        txt.Height = 19
        txt.Width = 80
        Me.Panel1.Controls.Add(txt)
0
 
davidrichardsonCommented:
if you need to create the panel aswell

        Dim pnl As New Panel
        pnl.BorderStyle = BorderStyle.FixedSingle
        pnl.Height = 100
        pnl.Width = 100
        Me.Controls.Add(pnl)
        Dim txt As New TextBox
        txt.Height = 19
        txt.Width = 80
        pnl.Controls.Add(txt)
0
 
TechMonsterAuthor Commented:
Is there anyway to use the UI to create the panel and link the newly created textboxes to it?
0
Industry Leaders: 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!

 
davidrichardsonCommented:
if i understand

       Dim txt As New TextBox
        txt.Height = 19
        txt.Width = 80
        Me.Panel1.Controls.Add(txt)

will add a textbox to a panel called panel1 at run time
0
 
davidrichardsonCommented:
is that what you were looking for?
0
 
TechMonsterAuthor Commented:
Yep
0

Featured Post

Technology Partners: 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!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now