Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Dividing Forms into Frames

zicheziche Posts: 47Member
How do you divide a form into those web page like frames?

You know, where the user is even able to adjust these frames' widths or heights through the draging of their borders?

Comments

  • zibadianzibadian Posts: 6,349Member
    : How do you divide a form into those web page like frames?
    :
    : You know, where the user is even able to adjust these frames' widths or heights through the draging of their borders?
    :
    :
    You need to use the TSplitter and 2 TPanels for that. The procedure is as follows for 2 vertical-split frames:
    - Place a TPanel with alLeft on the form
    - Place the TSplitter with alLeft (default)
    - Place the second TPanel with alClient.

    Then fill the panels with the controls you want. The right anchor can be used to make sure that they are resized properly if necessary.
  • zicheziche Posts: 47Member
    : : How do you divide a form into those web page like frames?
    : :
    : : You know, where the user is even able to adjust these frames' widths or heights through the draging of their borders?
    : :
    : :
    : You need to use the TSplitter and 2 TPanels for that. The procedure is as follows for 2 vertical-split frames:
    : - Place a TPanel with alLeft on the form
    : - Place the TSplitter with alLeft (default)
    : - Place the second TPanel with alClient.
    :
    : Then fill the panels with the controls you want. The right anchor can be used to make sure that they are resized properly if necessary.
    :

    Beautiful! Works wonderfully!

    Now, in the case of an MDI application, how do you restict the child forms into selected frames when they are maximized or moved?
  • zibadianzibadian Posts: 6,349Member
    : : : How do you divide a form into those web page like frames?
    : : :
    : : : You know, where the user is even able to adjust these frames' widths or heights through the draging of their borders?
    : : :
    : : :
    : : You need to use the TSplitter and 2 TPanels for that. The procedure is as follows for 2 vertical-split frames:
    : : - Place a TPanel with alLeft on the form
    : : - Place the TSplitter with alLeft (default)
    : : - Place the second TPanel with alClient.
    : :
    : : Then fill the panels with the controls you want. The right anchor can be used to make sure that they are resized properly if necessary.
    : :
    :
    : Beautiful! Works wonderfully!
    :
    : Now, in the case of an MDI application, how do you restict the child forms into selected frames when they are maximized or moved?
    :
    If memory serves me well, then child forms are always parented by the form itself, and never by another control. This means that you need to do some fancy repositioning to move a child form to another frame.
    The following works for 2 frames. You need to place the splitter and the alLeft panel, but not the alClient panel. The alClient part is the frame where the MDI children will be placed.
    On command of the user (or some other event) set the panel.Align to alRight, and then set the splitter.Align to the alRight. This should swap the two frames, and still keep them resizable. If the splitter appears to the right of the panel, swap the order in which the Align is set. If the MDI children appear over or beneath the panel, then you need to calculate their Left-position based on the new left of their frame.
Sign In or Register to comment.