Control Layout of Panel programmatically

N

Novice

Hey all, last question on this subject - I hope.

I'm programmatically adding a Panel to a webpage and also programmatically
I'm adding controls to that Panel.

How do I control the layout of those controls that I put into the Panel?

Right now they are all just getting put onto the same line - when I was
doing Java development I could set the layout for JPanels and then add
components to them.

Does the same principle apply for .Net Panels? If so, can you direct me to
a tutorial on how to do this?

Or show me via an example - how at least I can put a line separator in
between two controls - example:
Panel panel = new Panel();
Label label1 = new Label();
label1.Text = "some text";
panel.Controls.Add(label1);
//Need a line separator to be added to Panel here
Label label2 = new Label();
label2.Text = "some text";
panel.Controls.Add(label2);

Thanks,
Novice
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top