Solved

Main Form Centered

Posted on 2001-08-30
2
165 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
ID: 6442411
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
ID: 6442443
That works swell.
Thanks,
Ross
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

810 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