Link to home
Start Free TrialLog in
Avatar of TechMonster
TechMonster

asked on

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?
Avatar of davidrichardson
davidrichardson

       Dim txt As New TextBox
        txt.Height = 19
        txt.Width = 80
        Me.Panel1.Controls.Add(txt)
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)
Avatar of TechMonster

ASKER

Is there anyway to use the UI to create the panel and link the newly created textboxes to it?
ASKER CERTIFIED SOLUTION
Avatar of davidrichardson
davidrichardson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
is that what you were looking for?
Yep