How to write code and design?

V

Vasant

How to make Textbox and Button like
at 1 time
Textbox Button


at 2 time
Textbox Button
Textbox Button


Thank you.
 
J

John Padilla

depending on what container you wish to place the buttons into (ie the form,
panel etc) you do i like this:

the current webform:

This code happens in some type of event of your choosing:

string[] count = new string[2];
count[0] = "btOne";
count[1] = "btTwo";

this.Controls.Add((new TextBox()).ID = count[0]);
this.Controls.Add((new TextBox()).ID = count[1]);

Vy putting the ID value you can reflect through the this.Controls list and
find your new text boxes by name and set other properties.

Hope this helps
 
J

John Padilla

I forgot to add something.

Once you add your controls you can reference them by the Id value. To format
them you will also need to add a div or 2 into the panel and put the textbox
insid eeach div and use the div (as a server side control) to arange the
locations of the text boxes within the panel. You can also use CSS.
 

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

Members online

Forum statistics

Threads
474,077
Messages
2,570,566
Members
47,202
Latest member
misc.

Latest Threads

Top