Solved

How can I set the TCustomForm.clientheight to 768?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Communication Between RC4 Delphi <-> PHP 3 113
Performance of SQL statement 37 111
TEMBEDDEDWB how can i change its user agent ? 8 58
Firemonkey webbrowser scrollbars ? 1 38
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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