Link to home
Start Free TrialLog in
Avatar of davidheffernan
davidheffernan

asked on

Overriding the painting of TForm.Caption

The caption on my form changes dynamically since it contains the full path to the latest file opened.  If this path gets long then the right hand side of the caption is chopped off.  What I would like to do is to predict when this is likely to happen and use an abbreviated path.

To do I need 2 functions:

1. How many pixels are available for the caption in the caption bar.
2. How many pixels wide is a given string when drawn to the caption bar.

Any ideas??
ASKER CERTIFIED SOLUTION
Avatar of Cynna
Cynna

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
Avatar of davidheffernan
davidheffernan

ASKER

this looks good cynna - i can't try it out until tomorrow......

:-)
thanks very much indeed :-)
thanks very much indeed :-)