473,466 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

inserting controls between controls

If I want to create a button that adds text boxes to a form, how would I
write the code so that text boxes can be inserted between text boxes
that already exist?

For example, if this displays properly:

Main node 1
- child node (A)
- child node (B)
- child node
- child node
Main node 2
- child node
Main node 3
- child node
- child node

You get the idea. It's basically creating a tree hierarchy as the user
clicks the button. A new text box is added as a child node beneath the
currently selected text box.

What I'd like to know is, if I need to insert a text box somewhere (such
as between A and B above) how would I do this? Would I have to shift
everything down, or is there a method that allows insertion of controls?
Nov 17 '05 #1
1 1255
John Salerno wrote:
If I want to create a button that adds text boxes to a form, how would I
write the code so that text boxes can be inserted between text boxes
that already exist?

For example, if this displays properly:

Main node 1
- child node (A)
- child node (B)
- child node
- child node
Main node 2
- child node
Main node 3
- child node
- child node

You get the idea. It's basically creating a tree hierarchy as the user
clicks the button. A new text box is added as a child node beneath the
currently selected text box.

What I'd like to know is, if I need to insert a text box somewhere (such
as between A and B above) how would I do this? Would I have to shift
everything down, or is there a method that allows insertion of controls?

There is no in-built method of inserting a control and having it
automagically layout everything nicely.
Would not be too hard to code though with the right design.

You could make a layout method which would layout your controls
depending on your hierarchy which you would call after you added your
next control.

Cheers
JB
Nov 17 '05 #2

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

Similar topics

1
by: Udi | last post by:
Hi, I have a control "A" that displays a list of control "B". How do I add the ability to insert a new "B" to the list through a context menu? I mean, What do I need to do in the event handler...
0
by: Andrés Giraldo | last post by:
Hi! I'm trying to insert a container object to a page, my intention is to group some controls, make it visible or invisible on depends of some actions... manually, i'll do that with a div......
5
by: Brian | last post by:
I need help PLEASEEEEEEEEEEEEEEE..... I am trying to create a list of questions that have yes/no answers. There are 8 groups of questions. Based on who the user is that logs in will determine...
1
by: Jeffrey Todd | last post by:
I have successfully created functionality that mostly models what I'm trying to do - which is dynamically insert controls into a user control (ascx), and insert validation controls, also...
2
by: Alan Silver | last post by:
Hello, VWD Express seems obsessed with inserting loads of spaces at the start of each line whenever you drag controls into the source view. I guess this is MS' idea of making the source code...
4
by: savvy | last post by:
I'm developing a Garment Shopping Cart. On the Admin side, while inserting the each Product details, the user has to choose options of Colour Icons and Sizes for each Garment. All the colour icons...
3
by: rcoco | last post by:
Hi, I want to share this problem. I have a datagrid that will help me Insert data into sql database. So I made a button On my form so that when I press the button a new row on datagrid should be...
1
by: Emma Middlebrook | last post by:
Hi, I've implemented an AJAX update panel on one of my ASP.NET web pages. I generate and add controls to it dynamically. What I would like to do is tell it to start a new line before adding the...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.