Solved

Main Form Centered

Posted on 2001-08-30
2
163 Views
Last Modified: 2010-04-06
I am writing an app that has to fit on 800x600 screen. I am using
1152x864. So when I test I make sure it fits in an 8x6 screen. The
problem comes in on the 8x6 screen the main form is centered only if
the user has the Windows bar set to AutoHide. If they have always on
top the main form is not centered in fact a small portion of it is
below the application.
How do I center the main form in available screen space not total
screen space?
I have tried both ScreenCentered and DesktopCentered neither work the way I want.

Ross
0
Comment
Question by:bozo7
2 Comments
 
LVL 10

Accepted Solution

by:
Jacco earned 200 total points
Comment Utility
Hi Ross,

I think you should use DesktopCentered but if the screen is 800x600 you should set WindowState to wsMaximized

procedure TForm1.FormCreate(Sender: TObject);
begin
  if (Screen.Width = 800) and (Screen.Height = 600) then
    WindowState := wsMaximized;
end;

Regards Jacco
0
 
LVL 1

Author Comment

by:bozo7
Comment Utility
That works swell.
Thanks,
Ross
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

16 Experts available now in Live!

Get 1:1 Help Now