Lazarus/Delphi: Difference between Height and ClientHeight of a Form
Question by Guest | 2015-07-14 at 21:27
I have found two different properties of the TForm in Delphi and Lazarus which are both influencing the height of the Form or Window: Height and ClientHeight.
But what is the difference between those heights? Do both specifications have exactly the same effect? Because, I have seen that the values are differing a little bit. And which property should I use to change the height of my program application window?
Related Topics
Lazarus/Delphi: Width and ClientWidth - Difference
Info | 0 Comments
Delphi: Event Order of a Form - From OnCreate to OnDestroy
Info | 1 Comment
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Send HTML5 Canvas as Image to Server
Tutorial | 0 Comments
How to resize Image before Upload in Browser
Tutorial | 13 Comments
Delphi: Global Treatment of Errors (Exceptions)
Tutorial | 0 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Both properties are referring to the height of the window. The difference is how this height is calculated:
According to that, the value of "Height" will be a little bit greater than the value from "Clientheight".
Because the frame, the border and the title bar have another appearance and size on different operating systems or Windows versions, I recommend to set the width with ClientHeight whenever you would like to make the window fit to for example some controls created dynamically. Even the font type used and the selected user theme make the window border size vary, so that it is hard to rely on specific values. But sure there are other applications in which setting the Height property fits the needs more.
Whenever you want to set a window to its minimum possible height, accordingly, you have to set ClientHeight to 0 which is making only the title bar shown.
Apart from Height and ClientHeight, there are also the properties Width and ClientWidth which can correspondingly be used to determine the window width.
2015-07-17 at 18:50