PC Review


Reply
Thread Tools Rate Thread

Adding controls to a dynamic form?

 
 
Connor T
Guest
Posts: n/a
 
      16th Nov 2004
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




 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      16th Nov 2004
"Connor T" <(E-Mail Removed)> schrieb:
> 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'/...)

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      16th Nov 2004
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


>
> 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
>
>
>
>



 
Reply With Quote
 
Connor T
Guest
Posts: n/a
 
      16th Nov 2004
> \\\
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding dynamic controls fish Microsoft VB .NET 0 25th Oct 2005 09:27 PM
Adding controls to a dynamic form? Connor T Microsoft VB .NET 4 29th Nov 2004 06:58 PM
Dynamic Controls and Adding it to the Form First. Why? Tyler Carver Microsoft ASP .NET 3 18th Aug 2004 04:53 PM
Datalist adding Dynamic controls Patrick Microsoft ASP .NET 2 28th Jan 2004 10:38 AM
Adding dynamic controls to Access form sumi Microsoft Access Forms 2 15th Oct 2003 08:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 AM.