Adding controls to a dynamic form?

  • Thread starter Thread starter Connor T
  • Start date Start date
C

Connor T

Hi,

I have a form which is dynamically generated from the contents of a Database
using commands such as this:

hostform.Controls.Add(aRadio)
However, that adds the control to the top level window. I want to add them
to a panel i've created so that can do the scrolling

Any ideas?

Rgds,

Dan
 
Connor T said:
I have a form which is dynamically generated from the contents of a
Database
using commands such as this:

hostform.Controls.Add(aRadio)
However, that adds the control to the top level window. I want to add
them
to a panel i've created so that can do the scrolling

\\\
hostform.Panel1.Controls.Add(aRadio)
///

(Assuming that the control's modifier is set to 'Friend'/'Public'/...)
 
Connor,

Webform or Windowform?

For a windowform you have to set the
myControl.Location = New System.Drawing.Point(X, Y)
Accoording to the parent (the panel)

For a webform you have to do by instance
Me.Panel1.Controls.Add(New LiteralControl("<BR>"))
To go to a new row of controls

I hope this helps?

Cor
 
\\\
hostform.Panel1.Controls.Add(aRadio)
///

(Assuming that the control's modifier is set to 'Friend'/'Public'/...)

Excellent thanks! I kinda tried that, but put Panel1 in the wrong place,
Thanks!
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top