active title bar height URGENT!!!

Posted on 2004-10-26
Last Modified: 2010-04-16
Hi guys,

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

Please answer as detail as possible :)
Thank you!
Question by:AgeOfWars
    LVL 12

    Expert Comment

    Use GetSystemMetrics with parameter SM_CYCAPTION
    LVL 12

    Expert Comment

    procedure TForm1.Button1Click(Sender: TObject);
      caption_height   : Integer;
      caption_height := GetSystemMetrics(SM_CYCAPTION);
    LVL 12

    Accepted Solution

    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);
      TitleBarHeight: Integer;
      TitleBarHeight := Height - ClientHeight;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    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…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    884 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now