Resize form title bar height at run time

Posted on 2008-11-10
Last Modified: 2012-05-05
I've an application written in D7 that was designed to 'just fit' in an 800x600 window.  With the popularity of EeePC and others at 800x480, I need to resize everything.

I've managed to fit everything (manually code) in this 800x480, but have had to change the BorderStyle to bsSizeToolWin.  This works great in Win2K - but the title bar height under XP and Vista is such that some of my controls are cropped...

So, how might I (at run time) change the title bar height using Delphi 7?


Question by:edbored
    LVL 14

    Expert Comment

    This may not be exactly what you are looking for however it may suit your proposes
    BorderStyle := bsSizeToolWin;
    It will make your title bar smaller however you loose you minimize and maximize icons.
    LVL 1

    Author Comment

    That's exactly what I'm doing now (as per original post). That works just fine in Win2K - and obviously changes the title bar under Vista and XP - just not enough!
    I'm looking for a way to have a 'compact mode' - that can be turned on and off at run-time. I've found many posts here that allow me to configure the size of the title bar when the form is first created (intercept a bunch of messages) - it just isn't clear to me how I'd do this AFTER the form has been created - (again, I need to toggle 'standard mode' to 'compact mode' at run time).
    Thanks for posting.
    LVL 14

    Expert Comment

    I apologize for not reading the question carefully enough.

    Anyway I don't think you can gain control over just one of the title bars. I believe that you would have to make the change at the OS level - as is you had gone into Advance Appeance Settings of Windows.

    This may not be accepable in which case you will somehow have to make you're application screen fit into a slightly smaller place.

    Another approach would involve eliminating the Title bar altogether using bsNone and creating one of your own but now you would need to handle mouse down, mouse up, and mouse move events in order to handle form moves and resizes. It could get complicated.

    Yet another posiblilty is to look into various "skins" addons. I don't know much about them but perhaps there is an easier solution to be found there.

    Good luck :)

    LVL 1

    Accepted Solution

    I found this link:
    Pretty old, but might send me in the right direction.
    Not sure how to close this - should this be 'self-solved'? Your idea of eliminating the title bar would work - just not what I was looking for,...
    LVL 14

    Expert Comment

    This is a useful link. You should request to close the question accepting your comment as the solution.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    20 Experts available now in Live!

    Get 1:1 Help Now