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?
TechMonsterAsked:
Who is Participating?
 
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:
       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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
TechMonsterAuthor Commented:
Is there anyway to use the UI to create the panel and link the newly created textboxes to it?
0
 
davidrichardsonCommented:
is that what you were looking for?
0
 
TechMonsterAuthor Commented:
Yep
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.