Solved

Main Form Centered

Posted on 2001-08-30
2
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 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