Solved

How can I set the TCustomForm.clientheight to 768?

Posted on 1998-12-17
5
173 Views
Last Modified: 2010-04-04
How can I set the TCustomForm.clientheight to 768?

I have and application that I want to cover the full screen, with no border. This means that I set the Borderstyle := bsNone;
BorderIcons := [];

Since I work in 1024*768 resolution I set:
ClientWidth := 1028;

But then when I set ClientHeight to 768 it jumps back to 753 leaving Height at 780. I have tried this with both WindowState = wsNormal and WindowState = wsMaximized. This leaves an application that almost, but not quite, covers the screen. Why is this happening? Is there a way around it?

Bra
0
Comment
Question by:bra033098
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1351527
hi bra,

it seems the problem is only in designmode, because in designmode is always the windowstitle present and there will be a formula like maxclientheight := screenheight-windowstitleheight.

but you can set it at runtime

procedure TForm1.FormCreate(Sender: TObject);
begin
  form1.Top := 0;
  form1.left := 0;
  form1.clientwidth := 1024;
  form1.clientheight :=768;
end;

meikl
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1351528
You should also try different border styles. The sizing behaves different with different border styles...

Regards... Madshi.
0
 
LVL 3

Expert Comment

by:philipleighs
ID: 1351529
At design time, why not say:
BorderStyle = bsNone
BorderWidth = 0
WindowState = wsMaximized

Run the program, it covers the full screen and client height is 768 (at least it is on my machine)

With a menu bar, client height is less, but the window still covers the entire screen.

Note that setting the clientheight to 768 is maybe not the best idea. If someone runs your app on a higher resolution, it'll only cover the top left area of the screen. On a lower resolution, a status bar (if you have one) would not be visible. If you really want to set the clientheight, then use Screen.Height instead of 768.

0
 

Author Comment

by:bra033098
ID: 1351530
Meikl

Tried it, it works, thanks. Bit inconsistent?


philipleighs

Thanks for the tip on using Screen.Height instead. The application I am writing will always
be on the same type of machine and it is therefore not a worry, but do we ever know what the
future holds? (Ask Bill Gates about 640k)

bra
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 1351531
hi bra,

will you give me the points then accept,
otherwise reject.

meikl
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

21 Experts available now in Live!

Get 1:1 Help Now