By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,979 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,979 IT Pros & Developers. It's quick & easy.

inserting controls between controls

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.