473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Adding controls to a dynamic form?

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


Nov 21 '05 #1
3 1500
"Connor T" <ma********@hotmail.com> 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/>

Nov 21 '05 #2
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

Nov 21 '05 #3
> \\\
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
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
2
by: D Sheldon | last post by:
I am creating a server control that adds web controls (i.e. textboxes, etc) to a form. I use HtmlTable to build the table and insert the controls. Now I want to add validators to the textbox. Here...
2
by: Tim Marsden | last post by:
Hi, This is what I am doing, please comment if this is the correct way. I need to add controls to a form dynamically. Within the Page_Load event (is not Postback) I run a routine to create the...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
3
by: Tyler Carver | last post by:
I am trying to use some dynamic controls that are built and then added to tables. The problem that I am having is the timing of when I can populate the controls and have the state remain after a...
6
by: Nathan Sokalski | last post by:
I am trying to dynamically add controls to my page, but am having trouble with controls such as buttons. I have been able to add simple controls such as Label controls, because they can be placed...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
4
by: Mike Lowery | last post by:
I have an ASP.Net page that simply generates a dynamic page using Response.Write() statements to generate the HTML. This works great except that one of the things I want to generate is a...
1
by: srneu71 | last post by:
I have a project that requires a dynamically generated matrix table. The table is setup with 4 quadrants (N,S,E,W) with checkboxes to "link" the data in adjacent quadrants. The table has to be...
3
by: Nunzio | last post by:
I am trying to add specific form controls to a VBA collection, so that I can pass the entire collection to another function, and access the individual controls later. I have tried several...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.