Center Screen in any resolution or BrowserWidth

Discussion in 'ASP .Net' started by Greg Cyrus, Sep 28, 2004.

  1. Greg Cyrus

    Greg Cyrus Guest

    I want to center a webform to fit any screen-resolution or Browser-Width.
    Webform.Width=800px. How can I center the Webform to fit any size?

    (Thanx in advance)

    What I have tried before:
    I optimized the output for a 800x600 resolution - means:
    MainInfo-Form.width=800 and put the MainInfo-Webform inside the "mid"-frame
    of a frameset defined by [cols=(left,mid,right):= 1%,800,1%] - that means
    middle frame is always 800px; the rest (left and right frame) has to share
    the space that's left.

    I guess one cannot define a formula/function within the
    frameset.cols-definition like [max(1%,0) ,800, 1%] so the "left" frame would
    stop at zero (when getting into negative values) on a browser-resize. Left
    frame.width=0 causes the mid-frame stop/start at 0 (or 1) px. But now when
    resizing the Browser the left frame scrolls out of
    screen followed by the mid-frame and both vanish in negative viewport-area
    ...lost in time and meaning.
    Greg Cyrus, Sep 28, 2004
    1. Advertisements

  2. Greg Cyrus

    Patrice Guest

    Just embed your form in an element that can be centered.

    Patrice, Sep 28, 2004
    1. Advertisements

  3. Greg Cyrus

    Greg Cyrus Guest

    Just embed your form in an element that can be centered.

    which one for exaple?
    Greg Cyrus, Sep 28, 2004
  4. Greg Cyrus

    Patrice Guest

    Depends how this is done to mimimize changes.

    Most of the time, I would say that the form layout is done using tables. You
    can then center the table by adding the appropriate style. Most other
    elements should also allow to be centered...

    Something like :

    <table align="center">


    Patrice, Sep 29, 2004
  5. Greg Cyrus

    Greg Cyrus Guest

    I treid that.
    But when I use a table I cant use GridLayout to place WebControls. Even when
    I use a panel it won't go.
    The Cell-Property won't even let my assign an URL as content.

    Greg Cyrus, Sep 30, 2004
  6. Greg Cyrus

    Patrice Guest

    GridLayout is to place controls at absolute coordinates. My personal
    preference goes rather to FlowLayout...
    Don't really see what you mean here.

    Try an example such as :

    that place two datagrids side by side...


    Patrice, Oct 1, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.