[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1930
  • Last Modified:

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
0
edbored
Asked:
edbored
  • 3
  • 2
1 Solution
 
SteveBayCommented:
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.
0
 
edboredAuthor Commented:
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
0
 
SteveBayCommented:
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 :)

0
 
edboredAuthor Commented:
I found this link:
http://www.mindspring.com/~cityzoo/ttlbar3.html
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,...
 
Cheers,
EdB
0
 
SteveBayCommented:
This is a useful link. You should request to close the question accepting your comment as the solution.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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