Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Main Form Centered

Posted on 2001-08-30
2
Medium Priority
?
172 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 800 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 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