[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 542
  • 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

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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