Positioning dynamically created controls

G

Guy

Hi,

I have a page that adds controls dynamically to the page. How do I control
where these controls appear, relative to the other controls? I'd like all new
controls to be listed vertically between two existing controls.

Thanks,
Guy
 
V

Victor Garcia Aprea [MVP]

Hi Guy,

When it comes to positing you have mainly two choices: table layout or CSS.
I think you're looking for CSS positioning. Do some googling, there are tons
of info on how to set an elmement position by using CSS.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
My blog: http://clariusconsulting.net/vga
My profile: http://aspnet2.com/mvp.ashx?vga
 
M

Mohamed El Ashmawy

As Victor said, you could use CSS postioning for that.
For example, if you have a button control that you add dynamically, then
you can do the following:

Dim x As New Button
x.Style.Add("LEFT", "192px")
x.Style.Add("TOP", "224px")
x.Style.Add("POSITION", "absolute")

where left and top would be the position x and y on the page.

Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
 

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
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top