Mike P said:
I am using the following syntax in a loop to add controls to a panel :
this.pnlCharts.Controls.Add(cht);
How can I make it so that there are spaces between each control?
I presume this is a Web application (not WinForms) and therefore when you
say "panel" you are referring to an asp
anel control.
In that case, in order to position your controls, you can insert
additional controls such as a Label or a LiteralControl to provide the HTML
markup that will position your own controls. For instance, if you want to
insert a single space between your controls:
this.pnlCharts.Controls.Add(cht1);
this.pnlCharts.Controls.Add(new LiteralControl(" "));
this.pnlCharts.Controls.Add(cht2);
You could also insert a line break by means of new LiteralControl("<br
/>").
Or if you want finer control, you can dynamically create a TABLE and
insert your controls in different TableCells, or create DIVs, add your
controls inside each DIV and apply CSS styles to the DIVs to position them
as needed.