Solved

How can I set the TCustomForm.clientheight to 768?

Posted on 1998-12-17
5
185 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
[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
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

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

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…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 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