Solved

Main Form Centered

Posted on 2001-08-30
2
168 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

737 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