Ensure form always on screen

Posted on 2008-11-07
Last Modified: 2012-05-05
If a form is shown at a position on screen but it too tall or wide to be fully shown, could the form 'automatically' reposition to ensure that the whole form is always shown within the boundaries of a form or screen ?
Question by:hairybarbarian
    1 Comment
    LVL 36

    Accepted Solution

    You can use the Screen object to see if a form will fit on the screen/desktop/monitor

    If you only have 1 monitor:
    Screen.WorkAreaRect provides the bounds a form can use

    with Screen.WorkAreaRect
        Application.MainForm.SetBounds(Left, Top, Right, Bottom);

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now