change the position of the web controls at runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brettokumar
    New Member
    • Jul 2008
    • 31

    #1

    change the position of the web controls at runtime

    hi

    I want to know how to change the position of the web controls at runtime relative to some other control.
    by user like bbc.co.uk

    wat i hav to do for that

    plz share ur ideas
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Helpful tips

    You made no mention of the language you are coding in, but I think all of the .NET languages support the .Location and .Bounds properties of a control.

    Check the .Location and .Bounds of the control that is your base/anchor/starting point. Then calculate from there for the next control. Get the .Bounds.Width for example, then set the location of the next control to the Location of the first control + the width of that control + the space/margin you would like between the controls.

    [CODE=c]mySecondControl .Location.x = myFirstControl. Location + myFirstControl. Bounds.Width + nMargin;[/CODE]

    for example

    Comment

    Working...