• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

active title bar height URGENT!!!

Hi guys,

How do i get the height of the active title bar of the form?

Please answer as detail as possible :)
Thank you!
0
AgeOfWars
Asked:
AgeOfWars
  • 2
1 Solution
 
Ivanov_GCommented:
Use GetSystemMetrics with parameter SM_CYCAPTION
0
 
Ivanov_GCommented:
procedure TForm1.Button1Click(Sender: TObject);
var
  caption_height   : Integer;
begin
  caption_height := GetSystemMetrics(SM_CYCAPTION);
  ShowMessage(IntToStr(caption_height));
end;
0
 
esoftbgCommented:
Use ClientHeight to determine the height (in pixels) of the form’s client area. The client area is the usable area inside the form's border, excluding the title bar, scroll bars, and so on.

So the next code will get the TitleBar Height if you have not Horizontal ScrollBar and MainMenu ....

procedure TForm_Main.Button1Click(Sender: TObject);
var
  TitleBarHeight: Integer;
begin
  TitleBarHeight := Height - ClientHeight;
end;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now