Positioning dynamically created controls

Discussion in 'ASP .Net Web Controls' started by Guy, Dec 22, 2004.

  1. Guy

    Guy Guest

    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
     
    Guy, Dec 22, 2004
    #1
    1. Advertising

  2. 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


    "Guy" <> wrote in message
    news:...
    > 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
     
    Victor Garcia Aprea [MVP], Dec 23, 2004
    #2
    1. Advertising

  3. 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
     
    Mohamed El Ashmawy, Dec 23, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    1
    Views:
    1,685
    Natty Gur
    Jun 25, 2003
  2. Bryan Donaldson
    Replies:
    0
    Views:
    445
    Bryan Donaldson
    Nov 24, 2003
  3. Brian Smith
    Replies:
    4
    Views:
    728
    Brian Smith
    Jan 9, 2004
  4. Smokey Grindel

    positioning dynamically created controls

    Smokey Grindel, Oct 4, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    525
    Smokey Grindel
    Oct 4, 2006
  5. msimmons
    Replies:
    0
    Views:
    525
    msimmons
    Jul 16, 2009
Loading...

Share This Page