Link to home
Start Free TrialLog in
Avatar of edbored
edbored

asked on

Resize form title bar height at run time

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?

TIA.

EdB
Avatar of SteveBay
SteveBay
Flag of United States of America image

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

ASKER

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.
EdB
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 :)

ASKER CERTIFIED SOLUTION
Avatar of edbored
edbored

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is a useful link. You should request to close the question accepting your comment as the solution.